I am using a daughter theme of the Cherry framework. In this theme you have a custom post called portfolio. I have created posts in 2 different categories and i want the pagination to show me only the posts related to the same category as the post shown. To realize this i used the following code:
<!--BEGIN .pager .single-pager -->
<ul class="<?php echo $left_block; ?> pager single-pager">
<?php if (get_previous_post(true)) : ?>
<li class="previous"><?php previous_post_link('%link', theme_locals("prev_post"), true) ?></li>
<?php endif; ?>
<div>
<?php if (get_next_post(true)) : ?>
<li class="next"><?php next_post_link('%link', theme_locals("next_post"), true) ?></li>
<?php endif; ?>
<!--END .pager .single-pager -->
</ul>
But when doing this, the pagination on the page disappears. Could anyone help me out please?
Try using this code in regards to your question: