Links to previous and next post in the same category
-
About the navigation links to previous and next post, since there is the requirement to create and use many post categories to populate the parallax sections, I would suggest to change the navigation code to this (adding “TRUE”) in inc\template-tags.php:
<?php previous_post_link( '<div class="nav-previous">%link</div>', _x( '<i class="fa fa-hand-o-left"></i>%title', 'Previous post link', 'accesspress-parallax' ), TRUE ); next_post_link( '<div class="nav-next">%link</div>', _x( '%title<i class="fa fa-hand-o-right"></i>', 'Next post link', 'accesspress-parallax' ), TRUE ); ?>
In this way, the navigation links will point to the next and previous post in the SAME category of the post currently viewed.
(I’m a beginner in PHP, so I just tried to follow the codex and it works, if there is any better way to do this, please share it.)
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Links to previous and next post in the same category’ is closed to new replies.