Show only children of parent if there is any children
-
Hello.
I use this code to divide my main menu (parent categories) and my sub menu (children of parent categories)
<?php $cat = $cat; wp_list_categories("orderby=name&show_count=1&use_desc_for_title=0&hide_empty=0&child_of=$cat&title_li");?>
It works well, but when I click a child, my sub menu disappear. Obviously because WP is looking for children of the child.
Is it possible to make it only look for children if the current category is a parent. Shortly, I would like my sub menu to be accessible all the time, and just to change list elements according to which parent is clicked.
The normal wp_list_categories cannot be used cause the childrens ul is pushing the other parent items below.
I want a traditional main menu, with sub menu below.
Possible?
Thanks!
Viewing 2 replies - 1 through 2 (of 2 total)
Viewing 2 replies - 1 through 2 (of 2 total)
- The topic ‘Show only children of parent if there is any children’ is closed to new replies.