I have my search.php working fine. But I'd like to display the search results in my search.php filtered by tag_ID when is coming from another search form. I've tried several things like: wp_parse_str, new WP_Query( {parameters here} ), etc. Basically I don't know how to modify the query :(
How can I modify the main query in order to do that?
Thank you very much for your help!
PD: I've been reading several post here but no one answered my question.
This is my form code:
<form role="search" method="get" class="form-inline cp-form-search search-form" action="<?php echo esc_url( home_url( '/' ) ); ?>">
<input type="search" id="s" class="search-field form-control p-2" placeholder="<?php echo esc_attr_x( 'Search '.$venue_archive_title, 'placeholder' ); ?>" aria-label="Search" value="<?php echo get_search_query(); ?>" name="s">
<input type="hidden" value="restaurants" name="venue_type_search" id="venue_type_search" />
<input type="hidden" value="title" name="orderby" id="orderby" />
<input type="hidden" value="ASC" name="order" id="order" />
<button type="submit"><img src="<?php echo get_template_directory_uri(); ?>/assets/images/search-white.svg" height="22"></button>
</form>
I'd like to trigger the new query with my "venue_type_search" hidden input.
Thanks!
pre_get_posts
. But, "another search form" - where's the code?