WordPress.org

Forums

Next / Previous Posts linkage (13 posts)

  1. JustSue
    Member
    Posted 10 years ago #

    I've found oodles of plugins that allow you to link to the next post in a category, or the next day/week/month of posts, but how about just jumping to the next or previous post chronologically?

    Gah! Never mind. Found those template tags. Sorry.

  2. Nick Momrik
    Member
    Posted 10 years ago #

    This is how the default theme does it...
    <div class="navigation">
    <div class="alignleft"><?php posts_nav_link('','','&laquo; Previous Entries') ?></div>
    <div class="alignright"><?php posts_nav_link('','Next Entries &raquo;','') ?></div>
    </div>

  3. sylday
    Member
    Posted 10 years ago #

    When I use this, nothing shows up. Any idea why?

  4. pezastic
    Member
    Posted 10 years ago #

    I am using it with a new theme I'm making and it does fine. EXCEPT, the "Previous Entries" shows up when browsing in a category even when there are no previous entries available. Clicking on it shows a "Not Found".

  5. sylday
    Member
    Posted 10 years ago #

    How can I insert this to where it only shows up on the comments page? If I use <?php if ($single) { ?> it doesn't work at all.

  6. Jinsan
    Member
    Posted 10 years ago #

    Well I just tried it after scratching my head on how to do it and it works fine with the theme I use, though I can't seem to display it on the comments page - that's the next step for me.

    sylday - you can use the code without the navigation div or with I found, but you need to assign a class in your CSS - perhaps that's why it isn't displaying for you?

  7. Nick Momrik
    Member
    Posted 10 years ago #

    Look at the default theme in single.php. There is something very similar in there, but I think the functions used are different.

  8. Jinsan
    Member
    Posted 10 years ago #

    <div class="left"><?php previous_post('« %','','yes') ?></div>
    <div class="right"><?php next_post(' % »','','yes') ?></div>

    Is the code, though when I tried it I got a fatal call error

  9. bloodylamer
    Member
    Posted 10 years ago #

    Yeah, ever since I installed 1.5, I, too, have been getting a 404 when I click "previous entries" link on the front page.

    ANy suggestions?

  10. Nick Momrik
    Member
    Posted 10 years ago #

    Have you updated your rewrite rules?

  11. bloodylamer
    Member
    Posted 10 years ago #

    for some odd reason my front page's "Previous Entries" link is

    /archives/category/all/page/2/

    rather than the

    /page/2/

    I've updated my permalinks. The only thing I have in the permalinks -admin page is this:

    /archives/%year%/%monthnum%/%day%/%postname%/

    any help would be wonderful. A lot of users are being shown the 404

  12. nicepants
    Member
    Posted 10 years ago #

    I've been getting a 404 as well since I updated to 1.5.1

    Previous links points to "http://www.husseh.com/wp/cgi-system/php.cgi?paged=2"

    "cgi-system" doesn't even exist!

  13. brianmof
    Member
    Posted 10 years ago #

    me too. Previous links gives me a 404
    ".../wp/cgi-system/php.cgi"
    message. For me this is not an upgrade.

    Yet, the previous and next entry links work when I am in the archives.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.