WordPress.org

Ready to get started?Download WordPress

Forums

Grandchildren menu replaces children menu? (1 post)

  1. Kettercat
    Member
    Posted 1 year ago #

    Okay, I seem to have a problem with my grandchildren (third) menu - when I click on one of the grandchildren pages, the menu replaces the children (second) menu.

    As seen here -
    http://www.ultra.co.il/heb/new-collection/flatlight/
    Try clicking on one of the subpages, it goes on top.

    This is the code:

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

    What am I doing wrong?

Topic Closed

This topic has been closed to new replies.

About this Topic