I need to display the number of posts per each category in my WordPress theme. So it should appear like that:
- Cat1 (5)
- Cat2 (3)
- Cat3 (2)
The number is the number of posts, so 5 means 5 articles are in Cat1, etc….
I write the following code:-
<ul>
<?php wp_list_categories( 'orderby=name & title_li' ); ?>
</ul>
So what should I add to display the number of posts per each category?
Just add the show_count option:
There are plenty more options too if you want to customise the output further: wp_list_categories on WordPress Codex