I have a custom post type "vendor" - and I want to people to drill down via custom taxonomies to see posts. I have two custom taxonomies - one for "service" and one for "location".
So in a custom template I am listing all the available services... when one is clicked I load in another display that lists all locations (and I pass along the service ID in the URL query string)... when a location is clicked... (I pass the service ID and Location ID again in the query string) and I load in a list of vendors that are categorized with both that service AND location.
The problem I'm running into is that there is the possibility that on that location list - it will include a location for which no posts have the previously selected service.
So basically - when I get that list of locations, I need a list of locations that have posts that ALSO have been categorized with a particular service so I don't end up with an empty list.
For example: let's say I select the service "photography" - and then from my list of locations I select "Boston" - but I don't have any photographers in Boston... since that's the case... I don't want "Boston" showing up in that list.
While my list of services is a simple "get_terms" call... I think I need a custom select query ($wpdb->get_results) to grab that list of locations, but I'm just not sure what the query needs to be...