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.

One comment about “Fighting with previous/next post links

Comments on this post are now closed.