Here's my setup.
single.php
<?php
if ( in_category( 'my-category' ) ) {
include( TEMPLATEPATH.'/single-my-category.php' );
}
else {
include( TEMPLATEPATH.'/single-generic.php' );
}
?>
single-my-category.php
<?php
if ( have_posts() ) : while (have_posts()) : the_post(); ?>
<?php echo the_title(); ?>
<div class="pagination">
<div class="container">
<div class="row">
<div class="next col-xs-6 col-sm-6 col-md-6 col-lg-6">
<?php next_post_link( '%link', '<img src="' . get_template_directory_uri() . '/img/cs-left.png" /> PREVIOUS', true ); ?>
</div>
<div class="previous col-xs-6 col-sm-6 col-md-6 col-lg-6">
<?php previous_post_link( '%link', 'NEXT <img src="' . get_template_directory_uri() . '/img/cs-right.png" />', true ); ?>
</div>
</div>
</div>
</div>
<?php endwhile; endif; ?>
This is what i have followed - http://codex.wordpress.org/Function_Reference/next_post_link
I'm not quite sure what I'm doing wrong here as for some reason the previous_post_link is taking me to a post in a different category even though in_same_term parameter of the function is set to true.
Any ideas?
Thanks.