Title: Post Nav
Last modified: August 19, 2016

---

# Post Nav

 *  [mark-boyce](https://wordpress.org/support/users/mark-boyce/)
 * (@mark-boyce)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/post-nav/)
 * Hi,
 * I found an excellent post nav hack by Sam Burdge that enables a divider to be
   hidden if on first and last page.
    Here’s the code:
 *     ```
       <div class="navigation">
       		<div class="alignleft">
       			<?php posts_nav_link('','', __('&larr; Older')); ?>
       			<?php $divider = ' | '; ?>
       			<?php $page_num = $paged; ?>
       			<?php $max_num_pages = $wp_query->max_num_pages; if($page_num == ''){$page_num = '1';} ?>
       			<?php if($page_num>1 && $page_num<$max_num_pages){echo $divider;} ?>
       			<?php posts_nav_link('', __('Newer &rarr;'),''); ?>
               </div>
       	</div>
       ```
   
 * Could anyone advise me on how to modify this so that it works on single pages…?
 * Thanks.

Viewing 1 replies (of 1 total)

 *  Thread Starter [mark-boyce](https://wordpress.org/support/users/mark-boyce/)
 * (@mark-boyce)
 * [17 years, 3 months ago](https://wordpress.org/support/topic/post-nav/#post-972982)
 * I’ve tried:
    `<?php posts_nav_link('','', __('&larr; %link')); ?>`
 * But no joy…
    I’ve also tried: `<?php posts_nav_link('&larr; %link')?>`
 * Which shows posts but no divider…
    Any help would be greatly appreciated.
 * Cheers,
    Mark

Viewing 1 replies (of 1 total)

The topic ‘Post Nav’ is closed to new replies.

 * 1 reply
 * 1 participant
 * Last reply from: [mark-boyce](https://wordpress.org/support/users/mark-boyce/)
 * Last activity: [17 years, 3 months ago](https://wordpress.org/support/topic/post-nav/#post-972982)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
