Support » Fixing WordPress » category problem with previous_post_link and next_post_link

  • Hi there, I have a problem and I don’t know how to solve it.
    I have posts in more than one category.
    In my single I have the function get_category_list which is displaying the list of the category my single post is in and until now everything is ok.
    In my single I have also the functions previous_post_link and next_post_link which allow me to go to next or previous post. So let’s assume I select a category, I open the first post of the list then I use the next link to go to the next post of that category.
    The problem is the once my next post belongs to multiple categories, if the id of the category I’m in is bigger than the others parent categories, the next posts shown will belong to the category with the lower ID, so instead of finishing showing all posts belonging to that category chosen at first, it will start displaying posts from the other parent categories, all of them, ordered by id. What I want is displaying only posts that belong to the category chosen in the first step. Anyone have any idea to solve this problem?? Thanks a lot!

Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘category problem with previous_post_link and next_post_link’ is closed to new replies.