Forums

Child Menus (2 posts)

  1. Buckycat7
    Member
    Posted 4 years ago #

    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.

  2. StrangeAttractor
    Member
    Posted 4 years ago #

    I've used Rob Schumann's Fold PAge List plugin for this -- it's very useful.

    Unfortunately, his site seems to be down right now... hope the plugin is not dead...

    Link *was* here, for future reference:
    http://www.webspaceworks.com/resources/wordpress/30/

Topic Closed

This topic has been closed to new replies.

About this Topic