Answer the question
In order to leave comments, you need to log in
How to replace default Wordpress search with Woocommerce search?
I need to display the search in the last item of the top menu. Found the code, but there is a standard search.
How do I display woocommerce search?
in function.php registered
// начало кода формы поиска в меню
add_filter('wp_nav_menu_items','add_search_box', 10, 2);
function add_search_box($items, $args) {
ob_start();
get_search_form();
$searchform = ob_get_contents();
ob_end_clean();
$items .= '<li class = "my_search">' . $searchform . '</li>';
return $items;
}
// конец кода формы поиска в меню
Answer the question
In order to leave comments, you need to log in
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question