I'm looking for a function to return/ouput the link to the next and/or previous post in the same SUBcategory.
Using the previous_post_link() function it will only take into account the parent-category.
The structure of the categories is something like this:
- Work
- Graphic Design
- Webdesign
- Layout
- Illustratie
- Packaging
- Fotografie
So when I am on the single page of for example a webdesign-post I want links to other articles inside the webdesign subcategory. For now the next/previous_post_link() function just returns the next/previous link to a post inside WORK
Do any of you have a good solution for this? Plugin/custom code/....?
EDIT
I've found the solution to this one. I've tried building around it in the way that Boris suggested, but that didn't work for me. And then I found that I should just not add the parent-category in the edit page. Weird as it may be, this did the trick. Just add the child-category and it will be still pullen on page when you want all posts of the parent-category. But when using the previous_post_link()/next_post_link() it will just use the child-category!