P.S. Any way I could’ve posted that code more nicely? It came out pretty ugly…
Like this:
<ul>
<li><strong>Post Categories:</strong>
<ul>
<?php wp_list_cats('sort_column=name
&optioncount=1
&hierarchical=1
&hide_empty=0
&exclude=1, 3'); ?>
</ul>
<ul>
<div class="faint">
<?php wp_list_cats('optioncount=1
&hide_empty=0
&exclude=2,3,4,5,6,7,8,9,10,11,12,13,14,15'); ?>
</div>
</ul>
</li>
</ul>
Are there any children of your Uncategorized category? What happens if you replace the exclude list with &child_of=0 ?
There are no children. If I make the replacement with “0”, I get a full list of all the categories, not just the uncategorized one. My uncategorized posts category has an id of “1”, so I also tried replacint with a value of “1”, and the tag output nothing.
Hmmm, now that I’m playing around with it, it seems like this is a general rule: Once I have excluded a category in wp_list_cats, then in any subsequent calls to wp_list_cats, the post-count will always be zero for that category. Is this a known bug?
On my test blog, I did this:
<?php
wp_list_cats('sort_column=name
&optioncount=1
&hierarchical=0
&child_of=1');
?>
And it appears to have worked.
It might be a bug. list_cats() attempts to use a cache of categories; so suppressing some categories might negatively affect the cache.
Maybe try showing your Uncategorized category first, using my example above?
Strange, when I use that code it gives me a list of all of my categories. Note however that there are no “child_of” categories under category “1” (no subcategories).
For me to list the uncategorized posts FIRST I would have to either (1) set up a sub-category under “Uncategorized posts” and refer to that category using “child_of” or (2) exclude all of the normal categories, in which case I would no longer get the counts for THOSE categories…