• Resolved Sea Jay

    (@jcollier)


    Is there any way to display sibling pages?

    (We love being able to display child pages, but siblings would be icing on the display-posts cake.)

Viewing 4 replies - 1 through 4 (of 4 total)
  • Plugin Author Bill Erickson

    (@billerickson)

    Here you go!

    [display-posts post_type="page" post_parent="current" exclude_current="true"]

    Thread Starter Sea Jay

    (@jcollier)

    Since parent is set to current, doesn’t that only show child pages?

    • Parent
    – • Current
    – • Sibling
    – • Sibling
    – • Sibling

    On page Current, we would like to show a list of Sibling pages. Current has no children.

    Plugin Author Bill Erickson

    (@billerickson)

    Ah, I see what you’re saying. No, that isn’t possible with the settings currently built into the plugin, but you could pass your own custom parameter (ex: siblings="true") and then use the display_posts_shortcode_args filter to check for that parameter and customize the query.

    This is untested, but something like this: https://gist.github.com/billerickson/d8776675157a74fe3b9a18f9372366d2

    Thread Starter Sea Jay

    (@jcollier)

    Thank you! That works great!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘Sibling pages’ is closed to new replies.