G
G
Grizar2019-09-10 15:09:16
WordPress
Grizar, 2019-09-10 15:09:16

How to replace the search form?

We have a Wordpress Wookomers website with a Storefront theme.
We have two different search forms that work differently.
1-product search
2-site search
- these features are included in the theme.
In the upper right corner (header.php), a search form BY PRODUCTS is displayed, and I need a search form BY THE SITE .
Can I delete this form?

remove_action( 'storefront_header', 'storefront_product_search', 40 );

but how to add a search form ON THE SITE , I don’t understand
add_action( 'storefront_header', '????? ', 41 );
What to specify instead of ??????
It is necessary to change not the functionality of the form, but to replace one form with another?

Answer the question

In order to leave comments, you need to log in

2 answer(s)
A
Andriy Garkin, 2019-09-10
@andregarkin

Try looking towards template tags:
https://codex.wordpress.org/%D0%A2%D0%B5%D0%B3%D0%...
And another example solution is mentioned here:
https://hotexamples.com/ ru/examples/-/-/storefront...
Find the 'storefront_product_search' function in the storefront theme code (or possibly in its plugin codes).
Write next to (or better in a child theme) the 'storefront_allsite_search' function.
So instead of '????? ' you can specify 'storefront_allsite_search'.

P
Pychev Anatoly, 2019-09-10
@pton

get_search_form

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question