Not working in 2.5.1: posts_nav_link, next_posts_link, or next_post (4 posts)

  1. mechagrue
    Posted 8 years ago #

    This weekend I migrated from 2.0.11 to 2.5.1. I was surprised to find that my next_posts_link and previous_posts_link navigation system had stopped working. I use this to put "older" and "newer" links at the top of each single post, like:

    <?php previous_post('%','&laquo; Older', 'no'); ?> |
    <?php next_post('%','Newer &raquo;', 'no'); ?>

    which formerly lived on comments.php. You can see this working on my archive blog, e.g. here.

    After moving to 2.5.1 those links stopped displaying. I also tried posts_nav_link and next_posts_link, to no avail, e.g. editing my main index template to add the following inside The Loop:

    <?php if (is_single()) { ?>
    <?php echo "hello"; ?>
         <?php posts_nav_link(' &bull; ', __('&laquo; Newer Entry'), __('Older Entry &raquo;')); ?>
    <?php } ?>

    When I do this, my single posts simply say "hello." There is no output from the posts_nav_link tag.

    Out of curiosity, I loaded up the Kubrick theme. I added "there should be some nav here" such that the Main Index Template had:

    <div class="navigation">
    			<div class="alignleft"><?php next_posts_link('&laquo; Older Entries') ?></div>
    there should be some nav here
    			<div class="alignright"><?php previous_posts_link('Newer Entries &raquo;') ?></div>

    When I applied the Kubrick theme, that section of the page said "there should be some nav here." In other words, the next_posts_link and previous_posts_link didn't work. So I assume it's not me doing something wrong, since Kubrick came with my 2.5.1 install and I assume it's 2.5.1-compliant.

    Is there a magic new tag I should be using? (If so, the WordPress docs should be updated.)

  2. davidem
    Posted 8 years ago #

    I have to agree with mechagrue above... post- and next-links are not working with 2.5.1. Does anyone have an idea to fix this?

    /edit: Found some info here: http://mindfaucet.com/comicpress/2008/04/02/wordpress-25-bug-fix-for-comicpress/

  3. mechagrue
    Posted 8 years ago #

    THANK YOU! I used the fix at the linked site, and it worked a treat. You rule!

    It doesn't help the posts_nav_link() tag which still doesn't work. BUT that fix does get previous_post() and next_post() working. Hooray!

  4. stevesidea
    Posted 8 years ago #

    I found that when i disable my ancient "sticky" posts plugins it cleared up everything.

Topic Closed

This topic has been closed to new replies.

About this Topic