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