WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Link to previous post (10 posts)

  1. jmeeter
    Member
    Posted 7 years ago #

    At the bottom of my posts, I have << previous | next >>. Insteacof having those links link to /page/2/, how can I have it link to the actual permalink of the previous post? i.e. /2007/06/16/post/

    Thanks!

  2. moshu
    Member
    Posted 7 years ago #

    You cannot. You are mixing two different notions and link types.

    On your multipost pages (index, monthly and category archives) - you will always ahve exactly what you saw: page/2... /3... /4 etc. E.g. you have 45 posts and your blog is set to display 5 posts when reading > you will have 9 "pages" - it is called the paged view.

    On your single post view (after you click on the tiotle=permalink) you have the type of links that navigate between the next-prev single posts, based on their chronology.

    These two types of links use different template tags and they are NOT interchangeable.

  3. jmeeter
    Member
    Posted 7 years ago #

    Ok, thank you. Which template is used in /page/2/ ?

  4. moshu
    Member
    Posted 7 years ago #

    Which one you are asking about? :)
    http://codex.wordpress.org/Template_Hierarchy

  5. jmeeter
    Member
    Posted 7 years ago #

    Well, here is the problem. If you go to http://jordanmeeter.com/ and click "day before" it brings you to http://jordanmeeter.com/page/2/ - Now look at the links at the bottom. They are backwards! :p I'm trying to figure out what template they are in and how to fix it, haha.

  6. moshu
    Member
    Posted 7 years ago #

    Did you read the article I linked to?
    The answer to your question is there. And you need to edit the template tag > http://codex.wordpress.org/Template_Tags/posts_nav_link

  7. jmeeter
    Member
    Posted 7 years ago #

    The problem is, that displays

    "previous post -- next post"

    When I want

    "next post -- previous post"

    Because according to wordpress, "next" means older.

  8. jmeeter
    Member
    Posted 7 years ago #

  9. moshu
    Member
    Posted 7 years ago #

    No, "previous" (in time) means older. Previous always points to the posts the were publish earlier in time; and "next" from that "older moment in the time" comes back - through next - to the present day.

    Your problem is you put the labels in the wrong way; see the article in the Codex.

  10. bgoulette612
    Member
    Posted 6 years ago #

    On a semi-related note, on my site, I can change the labels well enough, but then I've got something like "Newer >> | << Older" when what I really want is "<< Older | Newer >>"

    Is there a way around this without having to hack any of the core files? Thanks!

    Also, just for kicks, I removed my custom labels, and the default labels are in fact backwards; that is, WP assigns "Next Page >>" when it means "<< Previous Page" and vice versa...

    I'm using WordPress 2.3.2, FYI.

Topic Closed

This topic has been closed to new replies.

About this Topic