Title: next_post_link(); help
Last modified: August 19, 2016

---

# next_post_link(); help

 *  Resolved [bluedrag](https://wordpress.org/support/users/bluedrag/)
 * (@bluedrag)
 * [15 years ago](https://wordpress.org/support/topic/next_post_link-help/)
 * Hello wordpress commuinity, I’m having a bit of trouble with the template tags
   next_post_link(); and previous_post_link(); I think it’s just because I’m alittle
   bit confused on how to implement them. Where would I put this code if I wanted
   it to appear on every single-post page. Somewhere inside the loop? If so where?
   I’m only a beginner when it comes to PHP and I’ve tried to put it in afew different
   places, both inside and outside the loop nothing seems to be working.
 * Would it work if I put it inside the post information itself (like, inside posts
   through the wordpress interface)
 * Any help would be great, here is the copy pasted code I’ve been using
 * previous_post_link( ‘%link’, ‘Prev’); ?>
    next_post_link( ‘%link’, ‘Next’); ?
   >

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

 *  [halfascissor](https://wordpress.org/support/users/halfascissor/)
 * (@halfascissor)
 * [15 years ago](https://wordpress.org/support/topic/next_post_link-help/#post-2057082)
 * Inside the loop.
    and you need `<?php` in front of both of those.
 * These links should help you out.
    [http://codex.wordpress.org/Function_Reference/previous_post_link](http://codex.wordpress.org/Function_Reference/previous_post_link)
   [http://codex.wordpress.org/Function_Reference/next_post_link](http://codex.wordpress.org/Function_Reference/next_post_link)
 *  Thread Starter [bluedrag](https://wordpress.org/support/users/bluedrag/)
 * (@bluedrag)
 * [15 years ago](https://wordpress.org/support/topic/next_post_link-help/#post-2057108)
 * actually i had the <?php i just forgot to put it in the post, my bad. I’ve read
   both of those pages a few times, doesn’t seem to be working 🙁
 * Does it matter where exactly inside the loop I put the code? should it be in 
   between two other pieces of code?
 *  [halfascissor](https://wordpress.org/support/users/halfascissor/)
 * (@halfascissor)
 * [15 years ago](https://wordpress.org/support/topic/next_post_link-help/#post-2057121)
 * Post the code of your single post page.
 *  Thread Starter [bluedrag](https://wordpress.org/support/users/bluedrag/)
 * (@bluedrag)
 * [15 years ago](https://wordpress.org/support/topic/next_post_link-help/#post-2057122)
 * I found the error 🙂
 * just for people who look at this thread later with the same problem as myself
   this snippet of code was stopping it from working for some reason
 * <?php the_content( __(‘<p>Read the rest of this entry »</p>’, ‘arras’) ); ?>
   
   <!–<?php wp_link_pages(array(‘before’ => __(‘<p>**Pages:** ‘, ‘arras’), ‘after’
   => ‘</p>’, ‘next_or_number’ => ‘number’)); ?>
 * After commenting it out, everything worked fine.

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

The topic ‘next_post_link(); help’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 4 replies
 * 2 participants
 * Last reply from: [bluedrag](https://wordpress.org/support/users/bluedrag/)
 * Last activity: [15 years ago](https://wordpress.org/support/topic/next_post_link-help/#post-2057122)
 * Status: resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
