Q:

Multiple Drop-Down custom taxonomies search

I know this question is asked many times on stack-exchange, but I am with something new
I want to have three Drop Down Boxes and a search button, the drop-down boxes will contain terms of 3 custom taxonomies, when I will select three values in it and hit search, I will get results which will be having these three terms in that post
It sounds weird but this is really a helpful search for a website
I am having a code(which I found on some website) which is working, but just for categories and only gives one drop down box, I want to make it for custom taxonomy which will be having 3 drop-down boxes,
here is my code:
function wp_search_form($form) {
$form = '<form method="get" id="searchform" action="' . get_option('home') . '/" >
<div><label class="hidden" for="s">' . __('Search for:') . '</label>
<input type="text" value="' . attribute_escape(apply_filters('the_search_query', get_search_query())) . '" name="s" id="s" />
<input type="submit" id="searchsubmit" value="'.attribute_escape(__('Search')).'" />
<br />
'.wp_dropdown_categories('show_option_all=All Categories&hide_empty=0&echo=0&selected='.intval($_GET['cat']).'').'
</div>
</form>';
return $form;
}

After writing this I have to just echo it, <?php echo wp_search_form(''); ?>
I edited according to my view, I just changed a single line to display the drop-down of custom taxonomy but when hitting on search it gives me No results found, Code I changed is this
'.wp_dropdown_categories('taxonomy=location&hide_empty=0&echo=0&selected='.intval($_GET['cat']).'').'
Location is my custom taxonomy name

A:

Wordpress in version prior to 3.1 does not support querying multiple taxonomies, you will need to install Scribu's plugin Query Multiple Taxonomies to fix that.
and in order to get the dropdown select box you can use wp_dropdown_categories()
like this:
$args = array(
    'taxonomy' => 'location',
    'hide_empty' => 0,
    'echo' => 1,
    'name' => 'location'
);
if (isset($_GET['location'])){
    $args['selected'] = intval($_GET['location']);
}
wp_dropdown_categories( $args );

