Support » Fixing WordPress » Not working in 2.5.1: posts_nav_link, next_posts_link, or next_post

  • 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>
    		</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.)

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Not working in 2.5.1: posts_nav_link, next_posts_link, or next_post’ is closed to new replies.