next_post_link doesn’t work for only the closest category
-
Hi there,
I am using “previous_post_link” and “next_post_link” & option “TRUE” set to output Prev and Next post title work within the same category. However, I have encountered one little problem under the following circumstance.
1. Parent category “Noodle” and 3 child categories underneath “Pasta”, “Udon” and “Ramen”
2. Those 3 categories have many post and at the end of each single page, I have set previous and next post_link.
3. I want to see prev and next title link from the same category. For example. if the post is from “Pasta” category, prev and next post should only output within the “Pasta category” not from “Udon” or “Ramen”.
4. previous and next post_link work fine in the way I want if I doesn’t select parent category “Noodle” but only “Pasta” before publishing.
The problem is that because all the posts over 1000 have parent category “Noodle” selected, previous and next post_link output prev and next titles from all the Noodle category which has mixture of 3 different child categories “Udon, Pasta and Ramen”…
In other words, I want to output prev and next title links from the closest category (not parents).
It would be great if you could give me advise to avoid this situation without unselecting parent category “Noodle” one post by another.
I hope my explanation makes sense.
Thank you.
Palmtree
- The topic ‘next_post_link doesn’t work for only the closest category’ is closed to new replies.