I have a post type called venues, and each post type has a list of values to choose from in my custom taxonomy 'location'.
- London (top level)
- West London (2nd level)
- North London (2nd level)
- East London (2nd level)
- Hackney etc.. (3rd level)
I would like to find results that match the lowest tier of taxonomy first, if there aren't any posts, then it will get results from the next taxonomy up, and so on. Each time the venue only has 1 value on each tier of the location taxonomy.
Any help much appreciated.
One thing that may help me write the code is if I knew how to load a taxonomy value by its term_id. Or if I could somehow determine the of the current taxonomy in relation to its parents.