Say a site has a category structure like:
Using it shows that and adds classes so that you can style it accordingly such as making sure sub levels are indented.
If you want to show just one hierarchy such as Dogs where the category Dogs is id 15 you could use:
<?php wp_list_categories( array(
'title_li' => '',
'child_of' => 15,
) ); ?>
When doing that it does this however:
That is, it does show just the Dogs tree, but it doesn't add the children class to be able to indent sub categories accordingly and seems to order them all by name, rather than just top level name.
Should be:
Am I missing something? Also if there were a category under say Fawn, I don't want that level or any further depths to show. Tried using "depth => 2," and didn't work. Setting to 0 shows all, setting to any other number such as 1 or 2 such shows the lowest depth.
Say a site has a category structure like:
Using it shows that and adds classes so that you can style it accordingly such as making sure sub levels are indented.
If you want to show just one hierarchy such as Dogs where the category Dogs is id 15 you could use:
<?php wp_list_categories( array(
'title_li' => '',
'child_of' => 15,
) ); ?>
When doing that it does this however:
That is, it does show just the Dogs tree, but it doesn't add the children class to be able to indent sub categories accordingly and seems to order them all by name, rather than just top level name.
Should be:
Am I missing something? Also if there were a category under say Fawn, I don't want that level or any further depths to show. Tried using "depth => 2," and didn't work. Setting to 0 shows all, setting to any other number such as 1 or 2 such shows the lowest depth.
Add 'style' => 'list'
to arguments:
wp_list_categories(array(
'child_of' => 15,
'title_li' => '',
'hide_empty' => 0, //just in case if no posts in category
'style' => 'list',
));
Your output should be:
Boxer
● Fawn
● Brindle
Rotweiler
Determined to be another plugin that was causing the issue of the ordering, "Simple Custom Post Order" removed that plugin and ordereding was fixed but sub categories still didn't have unique classes. Added hierarchical=1 and that resolved that too!