I use a Genesis theme and Pods templates for custom post types. I have 4 CPTs for different types of Artwork. Within a given CPT I have a pods field to indicate whether the artwork is available or has been sold. I display the pods on separate pages - one for available artworks and one for sold artworks for each CPT. But, I added pagination in Code Snippets. It appeared to be working fine, but I noticed that the pagination was including all of the posts whether they were sold or not.

My code is simple and based on these snippetes: https://gist.github.com/neilgee/43fdae964113c7e062e8 The relevant lines are:


I read in many posts that there were parameters I could use to limit the pagination to a particular taxonomy. So I set up a taxonomy called availability and assigned each artwork to either the sold or available category. Then I added the parameters to the snippet:

next_post_link( '%link','%title', TRUE, ' ', 'availability' );
previous_post_link( '%link','%title', TRUE, ' ', 'availability' );

but, they are not working for me. I tried variations, like adding $in_same_term = and $taxonomy =. But none of them worked. I can use the link and title parameters, but anything else and the nav links disappear.

Any advice? Thank You!

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.