Title: adding link to older posts
Last modified: August 19, 2016

---

# adding link to older posts

 *  Resolved [slgolden](https://wordpress.org/support/users/slgolden/)
 * (@slgolden)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/adding-link-to-older-posts/)
 * I searched the forum on this topic and was directed to the page explaining the
   next post/previous post links, but I can’t understand it. It’s marked as in need
   of editing, and that’s really true.
 * I understand that I need to edit the index.php file of my theme, but I don’t 
   know where to insert the links in that file.
 * Do I just add
    <?php previous_post(‘« « %’, ”, ‘yes’); ?> | <?php next_post(‘%»»‘,”,‘
   yes’); ?>
 * and where do I add it?
 * Thank you for any help

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

 *  [esmi](https://wordpress.org/support/users/esmi/)
 * (@esmi)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/adding-link-to-older-posts/#post-1068935)
 * > Do I just add […]
 * Yes – although now that you have read the Codex page on these template tags, 
   you’ll be able to edit the parameters according to your needs.
 * > where do I add it?
 * Right at the end of the Loop. After the `<?php endwhile; ?>` and before the `
   <?php endif; ?>`.
 *  Thread Starter [slgolden](https://wordpress.org/support/users/slgolden/)
 * (@slgolden)
 * [17 years, 1 month ago](https://wordpress.org/support/topic/adding-link-to-older-posts/#post-1069181)
 * Thank you so much! I managed to do it, although I found the code only worked 
   when I put it _after_ the `<?php endif; ?>`.
 *  [philtyler](https://wordpress.org/support/users/philtyler/)
 * (@philtyler)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-link-to-older-posts/#post-1069294)
 * It’s still not working for me. All I see is the “|”
    I tried it before and after
   the ‘<?php endif; ?>’
 *  [philtyler](https://wordpress.org/support/users/philtyler/)
 * (@philtyler)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-link-to-older-posts/#post-1069295)
 * Code is working, but is totally in the wrong place. Check it out at
    [http://www.philtyler.info](http://www.philtyler.info)
   scroll all the way down, how do I get them centered? Is there a way to switch
   the little arrows? Thanks!
 * oh here’s the code:
    ‘<?php endwhile; ?>
 *  <?php else : ?>
    <h2 class=”center”>Not Found</h2> <p class=”center”>Sorry, 
   but you are looking for something that isn’t here.</p> <?php include (TEMPLATEPATH.“/
   searchform.php”); ?> <?php endif; ?> <?php previous_posts_link(‘Newer Entries»’)?
   > <?php next_posts_link(‘« Older Entries’) ?> </div>’
 *  [philtyler](https://wordpress.org/support/users/philtyler/)
 * (@philtyler)
 * [16 years, 7 months ago](https://wordpress.org/support/topic/adding-link-to-older-posts/#post-1069296)
 * I got it with a simple ‘<p align=”center”>’
    ..next is getting the arrows correct..

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

The topic ‘adding link to older posts’ is closed to new replies.

## Tags

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

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 5 replies
 * 3 participants
 * Last reply from: [philtyler](https://wordpress.org/support/users/philtyler/)
 * Last activity: [16 years, 7 months ago](https://wordpress.org/support/topic/adding-link-to-older-posts/#post-1069296)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
