Restrict post navigation to current sub menu
As @Ravs mentions the third parameter in next_post_link()/previous_post_link() should be a boolean value indicating whether to restrict the link to a post in the same category. By default this is false. If set to true, it will choose the next (or previous) post which is in the same category as the current post. This includes … Read more