WordPress.org

Ready to get started?Download WordPress

Forums

Post Children OR siblings, not both (2 posts)

  1. lukemv
    Member
    Posted 3 years ago #

    I am using one navigation script on my site. I want to have the code to say (assuming it is on a level two page).... "list my children".... if it is a level three page (meaning you clicked a child link) it then says... "list my siblings".
    Make sense?

    I have the children part ok, but need help finding the parents children (siblings)..

    $children = get_pages('child_of='.$post->ID);
    if(count($children) != 0) {
       wp_list_pages('title_li=&depth=1&child_of='.$post->ID.'');
    }
    
    else{.....GET SIBLINGS.....}

    Thoughts?

  2. esmi
    Forum Moderator
    Posted 3 years ago #

    There are a lot of examples of sub-page listings on http://codex.wordpress.org/Function_Reference/wp_list_pages#List_Sub-Pages

Topic Closed

This topic has been closed to new replies.

About this Topic