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”.

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

<?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 responses and/or questions and read each and every one of them. Please note that your e-mail address will never be displayed on this site, nor will it ever be shared.

"Moderation" is in use. It may take a little time before your response appears. Responses containing unsolicited advertising will be deleted as spam (which means any subsequent attempts will be automatically relegated to the spam section and unlikely to be retrieved). For further information, please read the Discussion Policy.

One response to “Fighting with previous/next post links

Post a Response

You must fill in the "response", "name", and "email" fields. Please rest assured that your email address will never be posted or shared. This site uses Akismet to reduce spam; learn how your discussion data is processed. Please note that the field for your website URL has been removed. For more information about what can (or cannot) be included, please read the Discussion Policy.