Title: Next/Previous Post
Last modified: July 24, 2017

---

# Next/Previous Post

 *  Resolved [Alain Aubry](https://wordpress.org/support/users/caban13/)
 * (@caban13)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/nextprevious-post-4/)
 * Hi
    The addition of “Next/Previous Posts” in single post view was a nice addition.
   Next comes a request: What about moving along ‘Categories’? Wouldn’t be nice?
   Thanks Alain

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

 *  [Andrew Misplon](https://wordpress.org/support/users/misplon/)
 * (@misplon)
 * [8 years, 9 months ago](https://wordpress.org/support/topic/nextprevious-post-4/#post-9346675)
 * Hi Alain
 * Thanks for your message.
 * The next/previous navigation in posts and categories has been in Unwind since
   release.
 * Check Settings > Reading, how many posts are your blog page set to show before
   breaking them into pages? See the setting: **Blog pages show at most**. Do your
   categories have more posts than that number?
 *  Thread Starter [Alain Aubry](https://wordpress.org/support/users/caban13/)
 * (@caban13)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/nextprevious-post-4/#post-9599508)
 * Hi
 * Sorry I did not came here in so much time!
 * I guess I need to clarify, I was talking of “**Post navigation, Display next 
   and previous post navigation**“. Maybe it was always there but disabled by default.
   At some point this post navigation showed up without doing anything. This is 
   why I thought it was an addition. Never mind!
 * About the request: It would be nice to have the Next/Previous Posts buttons moving
   inside the current Category. Currently they go trough all categories. Maybe with
   a switch to select behavior.
 * Thanks!
 *  [Andrew Misplon](https://wordpress.org/support/users/misplon/)
 * (@misplon)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/nextprevious-post-4/#post-9600552)
 * Thanks for your feedback, that makes sense although I’m not sure when that happened.
   Sorry I don’t have more info.
 * The WordPress theme next/previous post navigation is by default a chronological
   function, it can however be customised to stay within the category. I’ll reply
   a bit later with a solution.
 *  Thread Starter [Alain Aubry](https://wordpress.org/support/users/caban13/)
 * (@caban13)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/nextprevious-post-4/#post-9600682)
 * Thanks!
 *  [Andrew Misplon](https://wordpress.org/support/users/misplon/)
 * (@misplon)
 * [8 years, 7 months ago](https://wordpress.org/support/topic/nextprevious-post-4/#post-9602049)
 * Try this. Go to Plugins > Add New, install Code Snippets > Activate. Go to Snippets
   > Add New, name the snippet any name you’d like, insert in the snippet body:
 *     ```
       if ( ! function_exists( 'siteorigin_unwind_the_post_navigation' ) ) :
       /**
        * Display navigation to next/previous post when applicable.
        */
       function siteorigin_unwind_the_post_navigation() {
       	// Don't print empty markup if there's nowhere to navigate.
       	$previous = ( is_attachment() ) ? get_post( get_post()->post_parent ) : get_adjacent_post( true, '', true );
       	$next     = get_adjacent_post( true, '', false );
   
       	if ( ! $next && ! $previous ) {
       		return;
       	}
       	?>
       	<nav class="navigation post-navigation" role="navigation">
       		<h2 class="screen-reader-text"><?php esc_html_e( 'Post navigation', 'siteorigin-unwind' ); ?></h2>
       		<div class="nav-links">
       			<div class="nav-previous">
       				<?php previous_post_link ( '%link', '<span class="sub-title"><span>&larr;</span> ' . __( 'Previous Post', 'siteorigin-unwind' ) . '</span> <div>%title</div>' ); ?>
       			</div>
       			<div class="nav-next">
       				<?php next_post_link( '%link', '<span class="sub-title">' . __( 'Next Post', 'siteorigin-unwind' ) . ' <span>&rarr;</span></span> <div>%title</div>' ); ?>
       			</div>
       		</div><!-- .nav-links -->
       	</nav><!-- .navigation -->
       	<?php
       }
       endif;
       ```
   
 * Opt to run the snippet on the site front end.
    Click Save Changes and Activate,
   not just Save Changes.
 * Does that help? Be sure to save and activate.

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

The topic ‘Next/Previous Post’ is closed to new replies.

 * ![](https://i0.wp.com/themes.svn.wordpress.org/siteorigin-unwind/1.9.20/screenshot.
   jpg)
 * SiteOrigin Unwind
 * [Support Threads](https://wordpress.org/support/theme/siteorigin-unwind/)
 * [Active Topics](https://wordpress.org/support/theme/siteorigin-unwind/active/)
 * [Unresolved Topics](https://wordpress.org/support/theme/siteorigin-unwind/unresolved/)
 * [Reviews](https://wordpress.org/support/theme/siteorigin-unwind/reviews/)

## Tags

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

 * 5 replies
 * 2 participants
 * Last reply from: [Andrew Misplon](https://wordpress.org/support/users/misplon/)
 * Last activity: [8 years, 7 months ago](https://wordpress.org/support/topic/nextprevious-post-4/#post-9602049)
 * Status: resolved