I have a vertical menu using the superfish script that shows categories in a custom 'productcategory' taxonomy. This menu has multiple levels, and is hierarchical.At the bottom of each branch of the tree we have the end category which represents a range of products, which the client does not want to show in this menu.
I am using this code to display it:
<ul class="frontcatlist sf-menu"> <?php $a = array( 'title_li' => '', 'taxonomy' => 'productcategory', 'depth' => 2 ); wp_list_categories( $a ); ?> </ul>
This is what I currently have in terms of what is showing and what isnt. left being the main categories, and each line being 1 step down to its children:
Those in the red are the categories that are not shown in the menu,
This is not what my client needs however. While I could produce a menu that fits the requirements using the native Wordpress 3 menus, that would require manual intervention, intervention that is undesirable, both from a usability perspective, and from the clients wishes.
Since some main categories have subcategories that should be shown and some dont, the depth parameter will not suffice. Instead this is what I need, with the top level categories always showing:
Im not sure how to do this, and the only clue I have is a custom walker class to output custom html, during which I might be able to filter out the ones I dont want ( any categories with a parent that has no children). But I could not see any sufficient examples or articles on the subject, and I'd rather not loose the classes and markup wordpress provides
If anybody has any thoughts, or knows of tutorials forum posts or articles of use, I'd much appreciate it =)