Hi,
I’ve looked into your request and stopped after 5 minutes because it would require to rewrite part of the GD search widget and also modify part of the advance search widget addon. Not even sure it can all be done only via hooks. Only Stiofan could tell us more about it…
I think there is a much simpler option that you should consider and that integrates Guust’s suggestion.
Instead of using 2 forms on the page that I agree would be bad UX, you could show only the form needed and add the selection Listings/Everywhere elsewhere.
Example: http://wpgeo.directory/
added a text widget above the gd search widget.
added 2 links “Listings” “Everywhere”.
added the regular search below the gd search widget and hidden with css.
added few lines of JS to show/hide one or the other
added little css for regular form to start look like listings form and give you the idea.
html for links in text widget:
<div class="alternative-search"><a id="gd-listings" href="#">Listings</a>
<a id="everything" href="#">Everything</a></div>
css:
.widget_search .screen-reader-text {
display: none;
}
#s {
float: left;
margin: 0 10px 0 0;
background-color: #fff;
}
.widget .searchform {
margin: 10px auto;
width: 33%;
}
.widget_search {
display: none;
}
jQuery:
<script type="text/javascript">
jQuery(document).ready(function(){
jQuery("#gd-listings").click(function(){
jQuery(".widget_search").hide();
jQuery(".geodir_advance_search_widget").show();
return false;
});
jQuery("#everything").click(function(){
jQuery(".widget_search").show();
jQuery(".geodir_advance_search_widget").hide();
return false;
});
});
</script>
If you like the idea, this can be accomplished with another 15 minutes of css and it took me 10 minutes from start to end.
Achieving the same modifying the code would take so much longer that I wouldn’t even consider it.
Let us know,
Thx