Hi guys,
I am using a native WP search field with a hidden input to search within a custom post type:
<input type="search" id="s" name="s" class="s" placeholder="Search" value="<?php echo esc_attr( get_search_query() ); ?>" autocomplete="off" />
<input type="hidden" name="post_type" value="watches" />
The search results page outputs the results which i echo using regular, default loop in search.php. The URL of the search results goes like this: ?s=rolex&post_type=watches
In the search results page i have created a filter to filter the search results.
The filter parameters are:
– Display results method: As an archive
– Use a custom template: true
– Filename of the custom template: search.php
The issue is that when i hit the filter button, it redirects me to blog page with the “Nothing Found” message. Could you tell me if it is possible to filter the search results which i get from the WP search or do i need to do something else?
Thank you.