WordPress.org

Support

Support » Themes and Templates » [Resolved] Link to previous post

[Resolved] Link to previous post

  • 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!

Viewing 9 replies - 1 through 9 (of 9 total)
  • 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.

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

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

    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.

    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

    The problem is, that displays

    “previous post — next post”

    When I want

    “next post — previous post”

    Because according to wordpress, “next” means older.

    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.

    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.

Viewing 9 replies - 1 through 9 (of 9 total)
  • The topic ‘[Resolved] Link to previous post’ is closed to new replies.