I stole a few lines from GaMerZ’s WP-Stats plugin and repackaged it into a Category Post Count plugin [see the sidebar] that enables you to display the number of posts in each category on the right side of the list.
If you’re interested in using the plugin post a comment or email me!
Here’s the code, copy and paste into a text editor and save as cpcount.php, then upload to your plugins directory and activate from your WP panel.
Update: Apparently WP comes with a built-in feature to do this [my bad!], but mine is presented in a slightly different visual style!




{ 13 comments… read them below or add one }
Hi there – I would love to have the plugin…
Thanks in advance!
you can use
<?php list_cats(‘optioncount=1′); ?> i think
Thanks, I’ve been looking for something like this. I tried to move the count a little to the left, though, and couldn’t figure that one out, but I do love having the count.
NP Julia, glad to have helped!
You could move them a little to the left by adding non-breaking-spaces [
] next to the count, or by padding the right side of the post count div by a few pixels.I clicked on the link to get the copy to copy & paste into a text editor but it gave me page not found. Would you please email me the code at the email addy listed?
Thanks
Sorry about that, I have the link fixed now!
thanks jerm for the code, hopefully i’ll be able to follow the simple instructions to make it work.
happy new years!
Good luck.. if you find any problems feel free to drop by again later!
I downloaded your plugin/hack and installed. It shows the number of posts in each category, BUT it takes away the link to each category…. the cat # is gone and link to nowhere…. any ideas?? also, is there a way to do it so the number of posts – the count – is in (23) brackets??
Tracy, that plugin was made for 1.2 so I don’t know if it still works; apparently not.. hehe.. I’ll drop you an email if I get a chance to fix it for 1.5, and I’ll look into the brackets thing, but I think WP has that feature by default now.
Please humour a complete idiot… I need to pass two arguments, so would the following be correct?
Damn, let me ask that again…
<?php wp_list_cats(‘sort_column=name’,'optioncount=1′); ?>
Madolyn » I think so but you better check the WP Codex to make sure.