Menu/submenu woes
-
I’m trying to have one div/ul print the menu and if the current page the user is on has sub-pages, print those to.
(I have that working).
What I don’t have working is how to keep the sub-page highlighted (I can do this via CSS) when we’re actually viewing the page.
e.g.
menu –> Home (id=1), About Us (id=2, selected)
submenu –> Staff (id=12), History (id=14, selected)and have the menu up when About Us –> History is selected.
Here’s my code:
<div id="menu-wrapper"> <div id="menu"> <ul id="nav"> <?php wp_list_pages('sort_column=menu_order&title_li=&depth=1')?> </ul> </div><!-- menu --> </div><!-- menu-wrapper--> <?php if (wp_list_pages('&child_of='.$post->ID.'&echo=0')) { ?> <div id="submenu-wrapper"> <div id="submenu"> <ul id="nav"> <?php wp_list_pages('sort_column=menu_order&title_li=&child_of='.$post->ID.'')?> </ul> </div><!-- submenu --> </div><!-- submenu-wrapper--> <?php } ?>
The whole submenu-wrapper div disappears when I have a child page selected.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Menu/submenu woes’ is closed to new replies.