When searching with the magnify glass and hitting enter, the results url looks like:
https://website.com/?s=SEARCHTERM
I want it to instead look like:
https://website.com/?s=SEARCHTERM&post_type=product
How do I accomplish this through function.php?
Edit: To resolve this I need to add <input type=”hidden” name=”post_type” value=”product”>
Original Code:
<form action=”https://website.com/” id=”searchform” method=”get” class=””>
<div>
<input type=”submit” value=”” id=”searchsubmit” class=”button avia-font-entypo-fontello”>
<input type=”text” id=”s” name=”s” placeholder=”Search” value=””>
</div>
</form>
How it should look:
<form action=”https://website.com/” id=”searchform” method=”get” class=””>
<div>
<input type=”submit” value=”” id=”searchsubmit” class=”button avia-font-entypo-fontello”>
<input type=”text” id=”s” name=”s” placeholder=”Search” value=””>
<input type=”hidden” name=”post_type” value=”product”>
</div>
</form>
Hey GCSkye,
Please have a look at the solution posted here
If you need further assistance please let us know.
Best regards,
Victoria