If I have a form:
<form class="search" action="<?php echo site_url(); ?>/page-search?category=2" method="get">
<input type="text" required name="search" placeholder="Search">
<button type="submit" class="sprite-psuedo"></button>
</form>
How would I add the custom page-search,
The
<?php
global $query_string;
$query_args = explode("&", $query_string);
$search_query = array();
foreach($query_args as $key => $string) {
$query_split = explode("=", $string);
$search_query[$query_split[0]] = urldecode($query_split[1]);
} // foreach
$search = new WP_Query($search_query);
?>
From Tutorial does not work. (Outputs nothing, it doesn't really seem to do anything). I tried too loop as well..
How do I process the form?