1

I have a page set up like

Page One - Page Red - Page Green - Page Blue

On Page One I can show the child pages with

    <ul>
        <?php
            wp_list_pages('title_li=&child_of='.$post->ID); 
        ?>
    </ul>

How can I show the sibling pages on Page Red, Green and Blue

So on Page Red, Green and Blue I would see Page Red, Page Green, Page Blue

2

You can query pages that have same parent excluding the page itself:

wp_list_pages('title_li=&child_of='.$post->post_parent.'&exclude='.$post->ID); 

Use parent instead of child_of to get only direct siblings without children of the siblings.

  • Hi gmazzap - Thanks for your reply, your code shows all pages – user668499 Feb 17 '15 at 8:42
  • @user668499 yep, I typed too quickly. I fixed the code, now should work. – gmazzap Feb 17 '15 at 10:58

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.