Get a free trial // Grow your CSS skills // Land your dream job

NO grandchildren

  • # September 9, 2009 at 9:25 pm

    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″);
    $children = wp_list_pages(“title_li=&child_of=”.$post->ID.”&echo=0″);
    if ($children) { ?>

    < ?php $parent_title = get_the_title($post->post_parent);
    echo $parent_title;

      < ?php echo $children; ?>

    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″);
    $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?

    # September 13, 2009 at 7:51 pm


Viewing 2 posts - 1 through 2 (of 2 total)

You must be logged in to reply to this topic.

There's a whole bunch of content on CSS-Tricks.

Search for Stuff   •   Browse the Archives

Get the Newsletter ... or get the RSS feed