previous_post_link() – Only in one category
-
I am using the previous_post_link() & next_post_link() functions to navigate to previous and next posts but only want it to show/navigate to post within the same category.
In my example the category I want to use is the “News” category which has a “category&tag_ID=16”.
I’ve read the wordpress Codex about this function here but am still not sure how to edit the parameters within the function so it only shows previous and next posts from a specific category.
NB. The posts on this website often use multiple categories but as explained earlier, the “news” category (16) is the one I’m looking to use.
Currently the code I am using is as follows:
<div class="posts_navigation_single"> <div class="posts_prev_single"> <?php previous_post_link(); ?> </div> <div class="posts_next_single"> <?php next_post_link(); ?> </div> </div>
I’d very much appreciate any help in the above subject.
Many thanks
The page I need help with: [log in to see the link]
- The topic ‘previous_post_link() – Only in one category’ is closed to new replies.