Created
May 23, 2015 13:13
-
-
Save pixedelic/5049aebe0c0efe87a1cd to your computer and use it in GitHub Desktop.
WooCommerce search widget + WPML implementation
This file contains hidden or 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
<form role="search" method="get" class="woocommerce-product-search" action="<?php echo esc_url( home_url( '/' ) ); ?>"> | |
<label class="screen-reader-text" for="s"><?php _e( 'Search for:', 'woocommerce' ); ?></label> | |
<input type="search" class="search-field" placeholder="<?php echo esc_attr_x( 'Search Products…', 'placeholder', 'woocommerce' ); ?>" value="<?php echo get_search_query(); ?>" name="s" title="<?php echo esc_attr_x( 'Search for:', 'label', 'woocommerce' ); ?>" /> | |
<input type="submit" value="<?php echo esc_attr_x( 'Search', 'submit button', 'woocommerce' ); ?>" /> | |
<input type="hidden" name="post_type" value="product" /> | |
<?php | |
if ( defined('ICL_LANGUAGE_CODE') ) | |
echo '<input type="hidden" name="lang" value="' . ICL_LANGUAGE_CODE . '"/>'; | |
?> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment