Category List Order
I hit a problem recently with WordPress, where basically when adding a new category lead to the category list on the right simply adding the new category on to the bottom.
This really didn’t appeal to me and I hadn’t noticed the fact that it displayed chronologically before (I imported the categories from my old B2Evolution install, and they were imported alphabetically by default).
The solution to this is very simple. Instead of calling the category list as you would normally:
[PHP] < ?php wp_list_cats(); ?>[/PHP]
You would call it with the following code:
[PHP] < ?php wp_list_cats("sort_column=name"); ?>[/PHP]
I hadn’t realised this before, but presumably this allows you to sort the category with any of the column names. I also expect this works with other functions (for example, selecting an archive list). It’s quite a useful find!
Wordpress, Category
3 years, 7 months ago