You only need one form and a callback on pre_get_posts
. For example:
<form role="search" method="get" id="searchform" action="<?php echo $current_url; ?>">
<input type="hidden" name="s" value="true" />
<!-- Tag Search -->
<label for="tags">Search Tag:</label>
<input type="text" value="Search" name="tags" id="tagsearchbox" />
<!-- Custom Field "autor" Search -->
<label for="autors">Search in Custom Field 'autor':</label>
<input type="text" value="Search" name="autors" id="autorsearchbox" />
<input id="searchsubmit" value="Search" type="submit">
</form>
Now your callback:
function alter_search_ppp_wpse_107154($qry) {
if ($qry_>is_main_query() && $qry->is_search()) {
// parse your fields here and alter the query with $qry->set like this :
$qry->set('post_per_page',10);
}
}
add_action('pre_get_posts','alter_search_ppp_wpse_107154');
You should validate that code. You have strange things happening, like multiple id
attributes on some elements and put that Javascript in a file and enqueue it.