- This topic has 3 replies, 2 voices, and was last updated 7 years, 3 months ago by .
Viewing 4 posts - 1 through 4 (of 4 total)
Viewing 4 posts - 1 through 4 (of 4 total)
- You must be logged in to reply to this topic.
Home › Forums › Pro Themes › Clean Commerce Pro › Add input in default search form located in header
Tagged: search form
Basically I want the search form to query the products and not the posts. In order to achieve this I imagined adding an hidden input in the search form to specify the target as below:
<input type="hidden" name="post_type" value="product">
I have implemented a few options but none of them works such as creating a new searchform.php file at the root of my child theme or adding a filter in functions.php file on ‘get_search_form’.
Any suggestions?
Hello @quintorium,
To make the search form search the product use you have to activate the child theme .
Child theme references :
https://codex.wordpress.org/Child_Themes
You can also create the child theme using the plugin . Below is the link to one of them.
https://wordpress.org/plugins/wp-child-theme-generator/
After creating the child theme in your child theme functions.php file paste below given code.
https://gist.github.com/anonymous/5e2063ef14efb06f2989cbe0937c3fb0
Hope this helps.
Let us know if you have any confusion further .
Best Regards!!
This is exactly what I wanted. It works like a charm.
Thanks for your help.
Cheers
Hello @quintorium,
Glad we could help you !!
If you have any issues further, please feel free to post your queries and we will happily help you further.
We will really appreciate if you could help us too by rating our theme in WordPress repo here:-
https://wordpress.org/support/theme/clean-commerce/reviews/
Best regards !!
Cookie | Duration | Description |
---|---|---|
cookielawinfo-checkbox-analytics | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Analytics". |
cookielawinfo-checkbox-functional | 11 months | The cookie is set by GDPR cookie consent to record the user consent for the cookies in the category "Functional". |
cookielawinfo-checkbox-necessary | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookies is used to store the user consent for the cookies in the category "Necessary". |
cookielawinfo-checkbox-others | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Other. |
cookielawinfo-checkbox-performance | 11 months | This cookie is set by GDPR Cookie Consent plugin. The cookie is used to store the user consent for the cookies in the category "Performance". |
viewed_cookie_policy | 11 months | The cookie is set by the GDPR Cookie Consent plugin and is used to store whether or not user has consented to the use of cookies. It does not store any personal data. |