I have a custom search with the following line of html in the form:
<input type="hidden" name="post_type" value="product" />
This correctly appends: &post_type=product to the search query in the URL
Unfortunately it returns a blank page.
When I remove the hidden field I get results but obviously none are included from my custom post type.
I have tried disabling plugins to no avail. I have tried swapping out my search.php page with the same file from TwentyFourteen. I have removed the search.php page completely.
I have tried installing plugins that provide the functionality of searching through custom posts to no avail.
This is a woo commerce site and when I use the woo commerce plugin (working fine on other sites) I get the blank page.
Regardless of what I have done I always get the blank page when I add any kind of custom code to my search.
WordPress and plugins are all up to date.
I have spent ages searching for a solution online to no avail.
I am stuck now so am reaching out for assistance with this one.
Any help or guidance would be greatly appreciated.
UPDATE:
After some additional testing I have discovered that this only happens when the post_type being passed to the query string is 'product'. I am using Woo Commerce and am trying to add a search for products to the standard WordPress search.
I still am scratching my head on this one.