captainsupern00b
Member
Posted 2 years ago #
Quick question: Is it possible to filter the previous/next navigation links for a post by multiple categories instead of just one? It looks like you can filter by one category using the in_same_cat parameter in the next_post_link() arguments list, but I'm uncertain how to do it by more... is there a way?
bobafettig88
Member
Posted 2 years ago #
Bump! I'm encountering this exact same problem. The docs mention...
<?php previous_post_link('format', 'link', in_same_cat,'excluded_categories'); ?>
...but "in_same_cat" just seems to grab the first category related to the post. Is there a way for this to work off of a combination of categories, not just one?
bobafettig88
Member
Posted 2 years ago #
Ha ha haaaa, wow, I am officially hating on the code base for WordPress now. =\ Why does WordPress allow you to associate multiple categories to a post when functions like previous_post_link() don't even consider all of them, only the first category related to the post? Am I missing something here? That's not intuitive at all!
jesseisrad
Member
Posted 1 year ago #
Same boat. I tried Excluding all the other categories associated with that post by ID and that just doesn't seem to work at all.
Ah, it IS a bug and a workable solution is here!