I have two custom post types
- Hotels
- Things to do
And I have two taxonomies
- Activities
- Regions
So when a user sees a Hotel (custom post): the user can then see
- the region it’s in
- what activities they can do.
And viceversa as well
When the user sees Things To Do, he can see in which Region it is and what Hotels have the same type of Activity nearby.
The problem if I use two custom post type and create a taxonomy for it, I have no way of discerning each taxonomy related to a custom post:
Example: Hotels in X Region
I would get both the Hotels and Things to do custom post, within that taxonomy.
It’s basically the same issue as this question (which doesn’t have any great answer).
Answers:
Thank you for visiting the Q&A section on Magenaut. Please note that all the answers may not help you solve the issue immediately. So please treat them as advisements. If you found the post helpful (or not), leave a comment & I’ll get back to you as soon as possible.
Method 1
I prefer set different taxonomies with distinct slug for them, I’m dealing with a project alike yours:
- Hotels (taxonomy is continent-hotels) values: Europe, Asia etc
- Places (taxonomy is continent-places) values: Europe, Asia etc
Even if both itens share same taxonomy and value, is easier to link the content than filter in frontend. Maybe I’m wrong but things seems tidier this way.
You can use non-hierarchical taxonomies for especific items such Hotels (romantic, economic, etc).
All methods was sourced from stackoverflow.com or stackexchange.com, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0