Support » Themes and Templates » Child Menus

  • I’m trying to customize a menu for a new wordpress theme I’m working on. I want a Menu bar across the top of the page, in the header, which is easy to do. But I what to have some child pages under the parent pages. But I would like the child pages to only show up in the sidebar when a visitor is on the parent page or other child pages under the parent. So the list of child pages would change from on parent page to the next. Basically trying to keep the main menu uncluttered with out a bunch of drop downs or other things.

    So I was reading the wp list page Codex page and came across this code:

    <?php
    $children = wp_list_pages('title_li=&child_of='.$post->ID.'&echo=0');
    if ($children) { ?>
    <ul>
    <?php echo $children; ?>
    </ul>
    <?php } ?>

    Is this close to what I would want to use or am I looking for something different? Or are their some changes that have to be made to this?

    I have seen the code before that will only show the Parent pages in the main menu so I know thats not a problem.

    Thanks.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Child Menus’ is closed to new replies.