WordPress.org

Ready to get started?Download WordPress

Forums

Navigation, parent, children only display 1st level children of page. (1 post)

  1. Themonsterbox
    Member
    Posted 11 months ago #

    Hi,

    I am trying to only display the children NOT grandchildren of each page here is a menu structure:

    Home
    About
    -Why
    -Where
    --Seattle
    ---Bellevue
    ---Georgetown
    --Tacoma
    --Bellingham
    Products
    -1
    --1.1
    ---1.1.1
    -2...

    I am using

    `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=0&depth=1");
    if ($children) {
    echo $children;
    } `

    which works great for first level but I need it to write out another menu for the childrens children when the original child is selected.

Reply

You must log in to post.

About this Topic

  • RSS feed for this topic
  • Started 11 months ago by Themonsterbox
  • This topic is not resolved
  • WordPress version: 3.5.1