WordPress.org

Ready to get started?Download WordPress

Forums

Previous/Next for Pages (20 posts)

  1. msky
    Member
    Posted 9 years ago #

    I use a lot of Pages in my sites and need a way to add "previous" and "next" titles to Pages � so that users could cycle forward and backward through Pages by ID# � the way they do with posts.

    Any ideas?

  2. Michael Bishop

    Posted 9 years ago #

    you might want to take a look at this page at the codex
    http://codex.wordpress.org/Template_Tags/link_pages

  3. msky
    Member
    Posted 9 years ago #

    Damn, I thought I looked everywhere! This looks like it will do it. Off to the day job, but will try it out tonight. Thanks

  4. msky
    Member
    Posted 9 years ago #

    Alas, the above suggestion just works for paginated pages � pages that are already part of a connected series. I have hundreds of single pages. I want to have the Titles of the previous and next pages (by date/id#) at the top of the page.

    Any ideas?

  5. roro
    Member
    Posted 9 years ago #

    what version you are using? in 1.5.1 cant be done, in 1.5 and earliers yes

  6. msky
    Member
    Posted 9 years ago #

    just upgraded to 1.5.1, but would go back to 1.5 for this. how would it work?

  7. Kafkaesqui

    Posted 9 years ago #

    "I want to have the Titles of the previous and next pages (by date/id#) at the top of the page."

    http://codex.wordpress.org/Template_Tags/next_post
    http://codex.wordpress.org/Template_Tags/previous_post

  8. moshu
    Member
    Posted 9 years ago #

    I am afraid the OP wants this on Pages (as opposed to posts). Which, AFAIK, doesn't really work, since Pages work by a different "logic" :)

  9. Kafkaesqui

    Posted 9 years ago #

    Pages
    pages
    need sleep

  10. msky
    Member
    Posted 9 years ago #

    You're right Moshu, that is the problem. I have several sites that rely heavily on Pages. I don't speaka da PHP very good, but this seems like it shouldn't be too hard.

    Would paypal a modest donation to the wordpress genius who figures it out.

    What's an OP?

  11. vkaryl
    Member
    Posted 9 years ago #

    "Original Poster" - IOW, you....

  12. Kafkaesqui

    Posted 9 years ago #

    As plugin functions (i.e. in next_page() | previous_page()), there's a major coding task involved in accounting for how Pages will be navigated, and requires the ability to modify Page assignment for what's considered next or previous based on (at the very least) Page creation date, Page order, and parent <> child relationships. Unless one is willing to live with some serious restrictions, this is not a simple rewrite of the current next/previous post tags.

  13. msky
    Member
    Posted 9 years ago #

    Well, if it can't be done, it can't be done. I'm pondering other options.....

  14. Kafkaesqui

    Posted 9 years ago #

    You may want to reread what I wrote above.

    I said nothing like "it can't be done." In fact, I just threw together a simplistic plugin that handles next/previous Page navigation based on post date. However, I don't see flipping through Pages by date to be very useful (if you do, email addy is on my site). Providing the ability to control what's considered a next or previous Page is not an impossible task, but it won't be pulled together over a fifteen minute code hacking session, either. It will take a while to work it out.

  15. msky
    Member
    Posted 9 years ago #

    By date works perfect for me.

    I post one new Page a day.

    I want at the top of the page to have links to "the day before" and "the day after," displayed as Page Title.

  16. msky
    Member
    Posted 9 years ago #

    Solved by kafkaesqui, with a simple little plugin. The wordpress community rocks.......

  17. blixel
    Member
    Posted 9 years ago #

    I have a documenation "project" that I want to move over to Word Press. It has about 25 to 30 pages total.

    I'm reading over these posts about a next/previous link for pages and I still don't understand what I'm supposed to do. When I copy and paste the PHP code into my page, I just see the actual PHP code when I go back to my page - it doesn't show me a "Next >>" hyperlink.

  18. Kafkaesqui

    Posted 9 years ago #

    @blixel: Which PHP code are we talking about?

    If you'd be happy with Page navigation based strictly on post date, contact me through email (follow link to my site).

  19. blixel
    Member
    Posted 9 years ago #

    @Kafkaesqui: I think I figured out what I needed. I just needed the <!--next-page--> comment to separate my pages. WP seems to have a navigation system built-in. I thought I needed to submit a new page for each page I wanted to be displayed. I didn't realize I only needed to create 1 "page". My only worry though is that when I finish this page, I'll have a Pages: section at the bottom that is 3 lines long. i.e. "Pages: 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27" and so on out to about 40 something pages.

  20. gothmog
    Member
    Posted 8 years ago #

    Kafkaesqui's plugin is here:
    http://wordpress.org/support/topic/43071

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags