display number of posts per category
Hi, I’ve been looking everywhere trying to figure out how to display the number of posts per category for WordPress 2.5. I understand there is a parameter for wp_list_categories, but I’d like to avoid this as I do not want to display the category names dynamically. Ideally, I would like to drop something like this in my header –
<ul id="nav"> <li><a href="#">Static Category</a> (<?php number_postpercat (4); ?>)</li> <li><a href="#">Static Category</a> (<?php number_postpercat (5); ?>)</li> </ul>
number_postpercat would be a function that grabs the total posts from whatever cat id i define. 4 and 5 are example cat id’s.
I found a post from 3 years ago on the forums located here:
The person was looking for something similar. I tried both methods but neither worked.
Hopefully you can help! Thanks in advance.
- The topic ‘display number of posts per category’ is closed to new replies.