• martin67

    (@martin67)


    I’m developing a web site (not a blog). The structure is flat & simple: Page-1, Page-2, Page-3, Page-4. Page-3 has 10 child pages: Page-3A, Page-3B, Page-3C…. etc.

    I need to insert hyperlinks in ONLY the child pages to be able to rapidly click through & display the child pages: so I need to insert hyperlinks “next page” “previous page”. Ideally when the last child page is displayed and “next page” is clicked it loops back to the first child page (Page-3A).

    I’m using Theme Twenty Ten and I’ve tried all known plugins but nothing applies to just a subset of child pages.

    Can somebody please help with a clever suggestion. Thanks in advance.

Viewing 1 replies (of 1 total)
  • Moderator bcworkz

    (@bcworkz)

    If you don’t mind adding a taxonomy term to all child pages, next_post_link() and previous_post_link() will work since you can restrict posts linked to to certain terms. The default taxonomy is category, but any taxonomy can be used.

    Looping back to beginning or end is possible by filtering the output with the “{$adjacent}_post_link” filter. When at the terminal page, the normal “output” is an empty string. Your filter callback can replace this with a link to the opposite terminal page.

    If adding a taxonomy term is untenable, I think it is possible to limit pages linked to by the parent page instead of a taxonomy term. This would involve altering the WHERE clause of the query used to find adjacent posts through the “get_{$adjacent}_post_where” filter.

Viewing 1 replies (of 1 total)
  • The topic ‘Next Page, Previous Page Links’ is closed to new replies.