adsense

How to Stop the Alphabetical Sorting of WordPress Categories





1. Log in to the WordPress dashboard, located at the 'wp-admin' directory of your website. Go to 'Appearance' and click the 'Editor' link to load the 'Edit Themes' screen.
2. Locate the template file used to list your categories under 'Templates' and click its link to open the file in the editor. Find the start of the WordPress loop:
Add this code above that line:


3. Add the type of category sorting you want between the equal sign and the single quote mark in the 'query_posts()' function. Your choices include none, ID, author, title, date, modified, parent and rand (short for 'random'). A few other options exist, but those options will not help you much in this case. Here is an example of a query that orders categories by their IDs:

4. Find the end of the WordPress loop:


There was an error.

The code will not look identical in every theme, but this example gives you the basic idea. Add this code below the '
' line to reset your query:

5. Save your work by clicking the blue 'Update File' button. Use the same solution on any other template file that lists categories as needed.

Comments

0 Responses to "How to Stop the Alphabetical Sorting of WordPress Categories"

Post a Comment

Popular Posts

About