Support » Themes and Templates » menu with paren and children without grand child

  • Hi im trying to create a menu with parent on top then i child (sub-menu), but when clicking on a grand child (which is a link on the child page) the child sub menu disappears or is replaced with the grand child pages instead of the child pages. Here is my code

    <?php if($post->post_parent)
    $children = wp_list_pages("title_li=&child_of=".$post->post_parent."&echo=0&depth=1");
    $children = wp_list_pages("title_li=&child_of=".$post->ID."&echo=0&depth=1");
    if ($children && is_page()) { ?>
    <ul id="subnav">
    <?php echo $children; ?>
    <?php } else { ?>
    <?php } ?>

    [Please post code & markup between backticks or use the code button. Your posted code may now have been permanently damaged by the forum’s parser.]


  • The topic ‘menu with paren and children without grand child’ is closed to new replies.