Hey, this is a BIG bump? Any help. Cuz I would like to use a sub menu with dynamic highlighting. Man, this must be the WordPress weakness of the century.
Found this link for listing of sub pages:
http://codex.wordpress.org/Template_Tags/wp_list_pages
“List subpages even if on a subpage “
I’ve also been using Fold page listing pages. Which is similar, but what you describe.
http://www.webspaceworks.com/resources/wordpress/31/
Mic
This seems to work for me:
Code:
<!-- Main Menu -->
<div id="mainmenu">
<ul>
<?php wp_list_pages('sort_column=menu_order&depth=1&title_li='); ?>
</ul>
</div><!-- / Mainmenu -->
<?php
if($post->post_parent)
$children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0");
else
$children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0");
if ($children) { ?>
<!-- Sub Menu -->
<div id="submenu">
<ul>
<?php echo $children; ?>
</ul>
</div> <!-- / Sub Menu -->
<?php } ?>
CSS additions:
/* =Current --------------- */
.current_page_item{}
.current_page_item a{
background: #FFFFFF;
}
.current_page_parent a{
background: #FFFFFF;}
.current_page_ancestor a{}
You likely have your menu’s li displayed as ‘inline’, if not then you’ll want to add that too.
Here you can find a tutorial regarding displaying dynamic menu pages