wp_list_categories show 6 posts ordered by count
-
Having an issue getting my wp_list_categories to display the proper number.
Basically, I want the list to show 6 top-level categories, sorted by count. However, it appears to be trying to incorporate the subcategories into the number, even if they are not shown. For example:
<ul><?php wp_list_categories('title_li=&depth=1&child_of=40&orderby=count&order=DESC&number=6'); ?></ul>
Shows only 2 categories:
Vegetarian
DessertsNot 6 as specified. If I change depth to 2 or -1, then I see 6 categories, but 4 of them are subcategories of the 2nd:
Vegetarian
Desserts
-Cookies
-Brownies
-Blondies
-CupcakesThe 4 subcategories here only have a few posts in them, and therefore should NOT be showing up if it was properly sorting by count.
Basically I want to ignore the subcategories completely, and only show 6 categories ordered by post count (so the 6 categories with the most posts in them will show). Logically it seems like that is what should happen, but it does not.
Any ideas why this isn’t working or how to resolve?
- The topic ‘wp_list_categories show 6 posts ordered by count’ is closed to new replies.