- This topic has 5 replies, 2 voices, and was last updated 1 month ago by .
This seems relatively simple so maybe I'm overthinking it, but here's the basic gist:
I have a CPT called destination.
I have a custom taxonomy called "state". The terms are state names.
I have a custom taxonomy called "destination-category". The terms are various types of destinations (ie: National Parks, State Parks, Camp Grounds, etc.).
Each destination post is assigned 1 state and 1 destination category.
So, for instance, I have three destination posts:
"Saguaro National Park" and assigned to the state "Arizona" and the destination category "National Park"
"Yosemite National Park" and assigned to the state of "California" and the destination category of "National Parks"
"Craggy Wash" assigned to the state of "Arizona" and the destination category of "Dispersed Camping"
As expected, on the "State" taxonomy page for Arizona it shows all of the destination posts assigned the state taxonomy "arizona" and the taxonomy pages for National Parks and Dispersed Camping do the same thing. That's all good.
What I want to do is have a taxonomy page that shows destination posts National Parks that are in Arizona etc.
Right now I'm not overly concerned about how the URL turns out, I'll deal with that later, I just want to show all posts that have share the same state taxonomy term and destination category term on one page. Preferably, I would like to do it in a way that doesn't require me to write a separate statement for every single term permutation.
On the state taxonomy page I'm using this
$state = get_queried_object();
Is it possible to do something similar to get the results I want? Would I need to use Relationships? I have no idea where to begin!
- You must be logged in to reply to this topic.