Forums
Forums / Fixing WordPress / Dynamic Submenu Navigation
(@guruxl)
18 years, 6 months ago
I am trying to get a sub menu set up for my site. I need it to be like this on top-level pages
Sub Pages
How can I do this? I know I can use this:
<?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) { ?> <ul class="submenu"> <li><a href="<?php get_permalink($post->post_parent); ?>">Overview</a></li> <?php echo $children; ?> </ul> <?php } else { echo '<ul class="submenu"><li>Overview</li>'; } ?>
Thanks for any help.
Any ideas?
The topic ‘Dynamic Submenu Navigation’ is closed to new replies.