Notice: This thread is over two years old; the information may be outdated. Please consider creating a new thread if you require free support. If you have an active SiteOrigin Premium license, you can email our premium support desk at [email protected].
I am trying to replace the vantage search form that is used in the menu search of the theme with a woocommerce search form. I came across this code from a while back.
This code is placed in menu.php:
<?php if( siteorigin_setting('navigation_menu_search') ) : ?> <div id="search-icon"> <div id="search-icon-icon"><div class="vantage-icon-search"></div></div> <form method="get" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>" role="search" <?php echo get_search_form() ; ?> </form> </div> <?php endif; ?>
And this code is placed in functions.php:
function woo_wc_search_form( $form ) { $form = '<li class="search"><form role="search" method="get" id="searchform" action="' . esc_url(home_url( '/' )) . '" > <input type="search" results=5 autosave="'. esc_url(home_url( '/' )) .'" class="input-text" placeholder="'. esc_attr__( 'Cerca', 'woothemes' ) .'" value="' . get_search_query() . '" name="s" id="s" /> <input type="submit" class="submit" id="searchsubmit" value="'. esc_attr__( 'Search', 'woothemes' ) .'" /> <input type="hidden" name="post_type" value="product" /> </form></li>'; return $form;
I am just looking for a bit of help with regards to where the code should be placed within the functions.php file. I can’t seem to figure it out.