Problem excluding category from get_next_post

I have a custom post type called “exhibitions” that uses the native “category” taxonomy. I have three categories: Current, Past, and Featured. Posts get marked either Current or Past and some are also marked as Featured.

I want my next/prev links on single pages to exclude the ‘featured’ category (tag_ID=21) so that my current and past posts don’t cross over when users are using post navigation, but I can’t seem to get this to happen. I have tried:

Read More

get_next_post(true,'21'), get_next_post(false,'21') and pretty much every other permutation of arguments, but my Past/Featured posts continue to show up adjacent to my Current/Featured posts in the post navigation.

Related posts

3 comments

  1. In Word.ress 3.9 (and still in 3.9.1) there’s a bug concerning the excluded terms in get_adjacent_post(). There’s a plugin to fix that bug.

Comments are closed.