treehouse : what would you like to learn today?
Web Design Web Development iOS Development

NO grandchildren

  • So I DO NOT want to show grandchildren. I know how to do this with the normal WP codex, but I'm not using in a normal way.

    Here's what I'm doing...

    <?php
    if($post->post_parent)
    $children = wp_list_pages(\"title_li=&child_of=\".$post->post_parent.\"&echo=0\");
    else
    $children = wp_list_pages(\"title_li=&child_of=\".$post->ID.\"&echo=0\");
    if ($children) { ?>
    <div class=\"summer_side\">
    <h3 class=\"child-nav\">
    <?php
    $parent_title = get_the_title($post->post_parent);
    echo $parent_title;
    ?>
    </h3>
    <ul>
    <?php echo $children; ?>
    </ul>


    Please help...
    Thank you so much.



    Ok I tried this:

    $children = wp_list_pages(\"depth=1&title_li=&child_of=\".$post->post_parent.\"&echo=0\");
    else
    $children = wp_list_pages(\"depth=1&title_li=&child_of=\".$post->ID.\"&echo=0\");

    .... no go. :(

    Any other ideas as to WHERE I should put this?
  • Anyone?