Title: previous/next post links
Last modified: August 19, 2016

---

# previous/next post links

 *  Resolved [ejm](https://wordpress.org/support/users/llizard/)
 * (@llizard)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/previousnext-post-links/)
 * I have just upgraded from 2.9.2 to 3.0.5
 * Everything appears to be in order except the [previous post](http://codex.wordpress.org/Function_Reference/previous_post_link)/
   [next post](http://codex.wordpress.org/Template_Tags/next_post_link) links above
   each post. These links used to appear only on the expanded post and not on the
   main page. What do I need to change in the coding so these links will show only
   on the actual post page?
 * Here is the coding I have now:
 *     ```
       <!-- start prev/next posts -->
       <div class="pstlnk">
   
       <?php previous_post('<b>&laquo</b> % <b>&laquo</b>  ', '', 'yes'); ?>  <?php next_post('  <b>&raquo</b> % <b>&raquo</b>', '', 'yes'); ?>
   
       </div>
       <!-- end prev/next posts -->
       ```
   
 * I hope the question makes sense.
 * -EMorris, Firefox 3.6.8, WinXP, WP3.0.5

Viewing 4 replies - 1 through 4 (of 4 total)

 *  Thread Starter [ejm](https://wordpress.org/support/users/llizard/)
 * (@llizard)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/previousnext-post-links/#post-1906547)
 * Just to clarify, I am trying to get the previous post/next post links above each
   post never to appear on the index page.
 * Here is the site: etherwork.net/blog/ «« I have purposely left that unlinked,
   in an attempt to keep spammers at bay.
 * -E
 *  Thread Starter [ejm](https://wordpress.org/support/users/llizard/)
 * (@llizard)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/previousnext-post-links/#post-1906595)
 * sigh… please excuse me for replying to myself yet again.
 * I just noticed that I was using the now deprecated tags `previous_post` and `
   next_post` ([http://codex.wordpress.org/Function_Reference/previous_post](http://codex.wordpress.org/Function_Reference/previous_post)).
   I have now changed the coding on my index page to read the following – it is 
   within the loop.
 * `<?php previous_post_link('<b>&laquo</b> %link <b>&laquo</b> &nbsp;'); ?> <?php
   next_post_link('&nbsp; <b>&raquo</b> %link <b>&raquo</b>'); ?>`
 * Irritatingly, the links are still showing on the index page.
 * **Just to reiterate, what must I do to get those links to show ONLY on the post
   page and not on the main blog page?**
 * -EMorris, Firefox 3.6.8, WinXP, WP3.0.5
 * etherwork.net/blog/ «« I have purposely left this unlinked, in an attempt to 
   keep spammers at bay.
 *  Thread Starter [ejm](https://wordpress.org/support/users/llizard/)
 * (@llizard)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/previousnext-post-links/#post-1906630)
 * Excuse me for replying to myself yet again. Because I did not receive any replies
   to my questions, I continued googling and searching. While it might not be the
   most elegant or perfect solution, I do think it works.
 * MichaelH suggested to “edit the single.php” in a reply to the thread [Display text on one post and one post only?](http://wordpress.org/support/topic/display-text-on-one-post-and-one-post-only?replies=4)
 * 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('<b>&laquo</b> %link <b>&laquo</b> &nbsp;'); ?> <?php
   next_post_link('&nbsp; <b>&raquo</b> %link <b>&raquo</b>'); ?>`
 * This will work well for now. I’ll stare at the following to see if there is a
   tidier way. [http://codex.wordpress.org/Conditional_Tags#A_Single_Post_Page](http://codex.wordpress.org/Conditional_Tags#A_Single_Post_Page)
 * -E
 *  Thread Starter [ejm](https://wordpress.org/support/users/llizard/)
 * (@llizard)
 * [15 years, 3 months ago](https://wordpress.org/support/topic/previousnext-post-links/#post-1906641)
 * I looked a little more at [http://codex.wordpress.org/Function_Reference/previous_post_link](http://codex.wordpress.org/Function_Reference/previous_post_link)
   and have now altered the coding to the following (I remembered to fix the character
   entities and make sure they ended with semicolons):
 *     ```
       <?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 #7 category) are showing up only on the actual post pages. Yay!

Viewing 4 replies - 1 through 4 (of 4 total)

The topic ‘previous/next post links’ is closed to new replies.

## Tags

 * [next post link](https://wordpress.org/support/topic-tag/next-post-link/)
 * [previous post link](https://wordpress.org/support/topic-tag/previous-post-link/)
 * [single.php](https://wordpress.org/support/topic-tag/single-php/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 1 participant
 * Last reply from: [ejm](https://wordpress.org/support/users/llizard/)
 * Last activity: [15 years, 3 months ago](https://wordpress.org/support/topic/previousnext-post-links/#post-1906641)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
