• I’ve made some changes to my blog page at https://www.smartshoputah.com/blog throughout today. So far, I adjusted the number of posts on the front page, added <?php the_excerpt(); ?> in place of <?php the_content(‘[More]’); ?>, and added a theme function to include a link to read the full post from the summary.

    Before I got all of that to work, I had been toying with <?php next_posts_link(); ?> and <?php previous_posts_link(); ?>. I was able to insert those lines in the index template along with some HTML code to move back and forth between posts, so it worked. However, I realized that I was changing between page numbers instead of post URLs, so my navigation wasn’t right. I set out to fix that but first took care of the other things mentioned above, then noticed that the functions for previous and next post won’t work at all now. I pasted it into many locations on several pages, even the index template again (though I believe it should go into the single.php file) and it won’t come up anywhere. I’ve been able to piece together everything so far, but this has left me befuddled. Any ideas on what could be causing this? Let me know if a copy/paste of my page content would help.

    Thanks in advance for any advice offered.

Viewing 3 replies - 1 through 3 (of 3 total)
  • I can’t see your links on the blog.

    Read this to see your options as well as information on where you should/n’t put the tags within your code.

    Thread Starter mrdelish

    (@mrdelish)

    I can’t see your links on the blog.

    That’s the problem – I can’t see the navigation links I paste in. They worked before all the changes, but not now. It makes a space for them as if there was something there, but it’s just blank (checked on Firefox in Ubuntu and IE6/7/8 on XP). After viewing the page you linked to, I attempted to paste in this snippet of code

    <div class=”navigation”><p><?php posts_nav_link(); ?></p></div>

    just before this one

    <?php if (have_posts()) : while (have_posts()) : the_post(); ?>

    I’ll probably end up restoring the backup I made before all my changes and then re-trying…

    Thread Starter mrdelish

    (@mrdelish)

    Scratch that – I was able to use the following code just fine (also from the page linked by bsutcliffe):

    <div class=”navigation”>
    <div class=”alignleft”>
    <?php previous_post(‘« « %’,
    ‘Toward The Past: ‘, ‘yes’); ?>
    </div>
    <div class=”alignright”>
    <?php next_post(‘% » » ‘,
    ‘Toward The Future: ‘, ‘yes’); ?>
    </div>
    </div> <!– end navigation –>

    That worked fine for some reason… odd. Anyway, thanks for the help! WordPress rawks.

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Previous and Next_Posts_Link not working… :(’ is closed to new replies.