Fighting with previous/next post links

summary: wp upgrade from 2.9.2 to latest stable wp version 3.0.5; I hate upgrades…

Sigh. When will I learn to WAIT a few days before upgrading to the most recent version of wordpress?

Heh. of course, I did wait. Last night, I decided that it was high time to upgrade from version 2.9.2 to 3.0.5. Unfortunately, I didn’t notice that 3.0.5 has JUST been released.

For the most part, everything went smoothly (I think). The only real problem I’m noticing is that the previous/next post links are now appearing on the main page. They didn’t used to.

I thought it was because I had used a now deprecated coding:
previous_post(); and next_post();

Apparently, these have now been changed :lalala: to previous_post_link(); and next_post_link();

Alas, changing to the current coding words has not resolved the problem. Nor has there been any response to my question about it in the wordpress forum. :stomp:

If you notice anything else awry, please do let me know….


edit 10 February 2011: I did not receive any replies to my questions in the wordpress forum but continued googling and searching. And I found the answer!! While it might not be the most elegant or perfect solution, I do think it works.

In one of the wordpress forum threads entitled “Display text on one post and one post only?”, there was a suggestion to “edit the single.php”.


My theme didn’t have a single.php file. But NOW it does. I have removed the following coding from my theme index.php and put it onto the newly formed single.php

previous_post_link('%link', '<b>&laquo;</b> %title <b>&laquo;</b>  ', FALSE, '7');
next_post_link('%link', '  <b>&raquo;</b> %title <b>&raquo;</b>', FALSE, '7');

And hey presto, the previous/next post links (with the exception of any links to posts in the “administration” category) are showing up only on the actual post pages. Yay!

This will work well for now. In the meantime, I’ll stare at the following page to see if there is a tidier way to achieve the same goal.

This entry was posted in administrative on by .

* Thank you for visiting. Even though I may not get a chance to reply to you directly, I love seeing your comments and/or questions and read each and every one of them. Please note that your e-mail address will never be displayed by me. Also note that you do NOT have to sign in to Disqus to comment. Click in the "name" box and look for "I'd rather post as a guest" that appears at the bottom of the "Sign up with Disqus". After checking the box, you will be able to proceed with your comment.

"Comment Moderation" is in use. It may take a little time before your comment appears. Comments containing unsolicited advertising will be deleted as spam (which means any subsequent comments will be automatically relegated to the spam section and unlikely to be retrieved). Disqus comment area  wp-image-2332