Bit of a challenge this one.
A Golf Holidays website has Custom Post types of ‘resort’ and ‘course’.
A Taxonomy called ‘destinations’ allows the CPTs to be assigned to hierarchical taxonomy terms which represent Countries and Regions of a Country e.g. ‘Portugal’ (parent term) and ‘Algarve'(child term).
If in a ‘Resort’ post, I wanted to say “…and here are the Courses nearby…” and display a list of the ‘course’ custom post types within the same taxonomy term as the current post, what structure would my loop have to take?
clarification of ‘Nearby’:
The Loop checking to see if first the Resort Post belongs to a child term, and displaying the Course Posts which match the same term, and then if current Resort Post belongs to no child term, then displaying Course Posts for the same parent term.
Would appreciate any ideas of how to approach?
- The topic ‘Show different custom post types related by Taxonomy’ is closed to new replies.