Expand Page submenu items for current page Only
-
I’m looking for an easy way to hide Page submenus except for the children of the current page. I’ve read a number of posts regarding this subject; one of them had a rather lengthy (20+ lines of code), which did not work for me.
My question is: is this still in the “hack” category, or has an easy fix for this been implemented for the latest version of WordPress 2.1.2, which is what I’m using? It seems to me that it should not be this difficult to have a navigation menu to work as “normal” – only expand the submenus of the current menu item, and leave the other top level menus unexpanded.
Instructions here do not work for me: https://codex.www.ads-software.com/Template_Tags/wp_list_pages
perhaps because there is already a wp_list_pages called in my Sidebar.php page as follows (which now expands ALL of the submenus):<?php wp_list_pages(“sort_column=menu_order&depth=0&title_li=”); ?>
A few more details about my site: I am not using any “blog” features at the moment (no posts, no comments). Only have the Pages to make it look more like a “static” site. Which is why I’d like to have the Page navigation to work right. Also, for the time being, I only have 2 levels of menus – parent with 0 or more children – no sub-sub-menu.
Any help would be greatly appreciated.
- The topic ‘Expand Page submenu items for current page Only’ is closed to new replies.