Hello
I have searched for this but no luck. Im new here and this is my first serios blog so I need to get everything right before launching it.
Empty Categories don't show up in the sidebar, how to change this ?
What file do I need to modify and with what code ?
Edit: Also, how to show categories according to ID's and not titles :)
Thank You.
You'll need the hide_empty parameter for the template tag, wp_list_categories.
An example of this is the WordPress Default 1.6 Theme where wp-content/themes/default/sidebar has this code
<?php wp_list_categories('show_count=1&title_li=<h2>Categories</h2>'); ?>
you would change to this code:
<?php wp_list_categories('hide_empty=0&show_count=1&title_li=<h2>Categories</h2>'); ?>
Also see:
Stepping into Templates
Stepping into Template Tags
Template Hierarchy
Thanks a million. Its working.
Do you happen to know how to have categories listed in the sidebar according to ID's :)
Thank You.
it does that by default.
He provided several links that explain all of that for you.
I did not notice the links he provided, just grapped the code and ran to try it :)
To sort categories by id and show empty one's at the same time:
<?php wp_list_categories('orderby=id&hide_empty=0&show_count=1&title_li=<h2>Categories</h2>'); ?>
Thank You :)
amitpatel3001
Member
Posted 4 years ago #
Excellent thread, helped me out while i was searching for the same on other blogs.