I have a problem. I have this categories and subcategories
Main CAT #1
---- Child CAT#1
---- Child CAT#2
---- Child CAT#3
Main CAT #2
---- Child CAT#4
---- Child CAT#5
---- Child CAT#6
What I’m trying to do is to retrieve only the child of the Main CAT #2 and Main CAT #1 mashed up and ordered by count.
<?php wp_list_categories('orderby=count&order=DESC&title_li' . $category->cat_ID); ?>
What is missing? Any idea?
I don’t think there’s a dynamic query you can do, but you could include the following two parameters to flatten the list, and exclude the parent categories:
depth=-1 //all categories displayed in flat (no indent) form
exclude=1,5,7 //exclude certain categories, so you could list your parent categories here by id..