WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

Im trying to make previous_post_link and next_post_link work inside a custom post type, inside a same category (taxonomy) but its not working.

It this posible ?

Im trying

<?php previous_post_link('<div class="posts-next">%link</div>', 'Next in category',TRUE); ?>
share|improve this question
up vote 1 down vote accepted

I'd suggest using a plugin for this. next_post_link and previous_post_link will use the category taxonomy (literally)*, so they will not work as expected with custom taxonomies, which I think you are using here.

I've used both Smarter Navigation by Scribu and Ambrosite Next/Previous Post Link Plus, which are both great plugins for this sort of thing.

*See the source for get_adjacent_post() which is used by WP's next/previous_post functions in \wp-includes\link-template.php to see how "category" is hard-coded.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.