WordPress.org

Support

Support » Miscellaneous » [Resolved] previous_post_link() and next_post_link() only for siblings on pages

[Resolved] previous_post_link() and next_post_link() only for siblings on pages

  • Richard Archambault

    @richardmtl

    Happiness Engineer

    Hi!

    Is there a way to use previous_post_link() and next_post_link() only for page siblings (and not “posts”)? I have a strict page hierarchy (3 levels of descendants) and I want to include previous_post_link() and next_post_link() in my page template without the links going to “uncles” for example. My understanding of previous_post_link() and next_post_link() is that they go to the previous and next created pages, chronologically. That doesn’t work for me because I’m creating my pages at different times. Any way to keep the links to their siblings?

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘[Resolved] previous_post_link() and next_post_link() only for siblings on pages’ is closed to new replies.
Skip to toolbar