When you begin using WordPress, you realize that it can be fairly easy to setup a website quickly. However, when you wish to customize your WordPress, it is then that you can run into many problems. One of the problems that many people run into with WordPress is the order of their categories. In this article, I will tell you how to arrange your WordPress categories using the WordPress “My Category Order” plugin.
WordPress Category Order: The Default Category Order
I use the Fresh News theme from Woo Themes which I really like. On this website, my goal was nicely presented text in a professional, elegant style. Fresh News is not too difficult to setup, but I did have to customize a few things and one of those things was the WordPress category order.
You may have read my article WordPress categories where I express just how underutilized WordPress categories are as a means for much more traffic to your website. But, how do you arrange your categories so that they show up on your menuing system exactly how you want them?
The default setup that came with Fresh News did not work for me. The category order looked like what you see in the photo below:
This default category order in WordPress was being displayed in the order that I had created the categories. This did not work for me because it was not prioritized how I wanted. So, I had to arrange my categories in a different way but I did not want to have to delete all of my categories and start from scratch.
I wanted to arrange my categories in the manner that you see in the photo below (it’s also live in the above menu):
How To Arrange Your WordPress Categories
With a little digging, I found where the list of categories was being generated. Since it is in the header part of the document, I visited the header.php in my WordPress root file and found these lines:
These are the lines that executed the original, default WordPress category order (seemingly by creation date).
To remedy this, I found a great little plugin called My Category Order. This plugin allows you to arrange your categories to your liking. Then, you can make slight modifications to your header.php code and you will be all set.
Here is how it works.
After you setup the WordPress Category Order plugin, you simply arrange the categories in the order you want by dragging and dropping them within the WordPress admin console as you see in the photo below:
Now, you need to change the code in the header.php to this:
As you can see, the changes are slight. The main change for the categories is “orderby=order” which tells WordPress to display your categories in the order that you have displayed them from the My Category Order plugin.
How To Order WordPress Categories
WordPress categories are a great asset within WordPress. Often, the default category setup will not meet your needs. In these cases, download the My Category Order WordPress Plugin, arrange your categories, and then modify the PHP code in the header.php to reflect your new WordPress Category order.
If you follow these steps, your new WordPress category order should be all set.
9 Comments on “WordPress: How To Order WordPress Categories”
Pingback: Blogging for Profit Carnival for May 31, 2010 | BlogConduit.com
This is a great solution to my problem, I think this should be done as part of the wordpress core.
Superb and works like magic in 3.0.4. Thank you so much!
This plugin looks good but what if there is no wp_list_categories();
in header.php ?
Thanks, this has solved my problem on the “Headlines” WooTheme 🙂
This dosn’t work for me.
I have different code in In orginal header.php:
cat_ID ); ?>
Can You help me with this?
Thank you. I already had My Category Order installed, but it was not working. Thanks reminding me to edit the header file. However, if you cannot find the wp_list_categories() function in the header file, I sound it in Sidebar.php (naturally)..
thanks again 🙂
@Rozpacz
The function you are looking for is in sidebar.php not header.php
Thank you very much for the help. I was able to upload the plugin but could not arrange it properly even after activating the plugin, by changing lil script i mean by writing orderby=order i could manage to arrange, thanks a lot.