Created
November 15, 2017 10:34
-
-
Save itthinx/d72dbe722d9a314e0ec96c84f0482f6a to your computer and use it in GitHub Desktop.
Using WooCommerce Product Search and replacing the default Search Form in Storefront and its child themes
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
function storefront_product_search() { | |
if ( function_exists('storefront_is_woocommerce_activated' ) ) { | |
if ( storefront_is_woocommerce_activated() ) { ?> | |
<div class="site-search"> | |
<?php | |
if ( function_exists( 'woocommerce_product_search' ) ) { | |
echo woocommerce_product_search(); | |
} else { | |
the_widget( 'WC_Widget_Product_Search', 'title=' ); | |
} | |
?> | |
</div> | |
<?php | |
} | |
} | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment