WordPress Search/Query two terms from separate taxonomy.

This is kind of related to the Directory plugin that i’m using. But its the WordPress core i’m interested in.

I have a directory… I have added a new taxonomy for areas. So now i have two separate taxonomies assigned to my custom post type.



What i need to do is make a search form that queries posts that are in the two terms.


listing_category -> plumber

listing_areas -> area_3

This needs to return all posts that are in both terms.

Although bare in mind i can use a town custom field i have defined if its a better solution?

I would ideally like drop downs for both. where user selects category and then area. But im thinking a good place to start is clarifying a query_posts or wp_query that works. Then i can set about passing search values to variables like $listing_area and $listing_category to use in the query.

Can anyone advise me of the best solution for my needs and if i’m going in the right direction.