Created
December 12, 2013 09:17
-
-
Save corsonr/7925232 to your computer and use it in GitHub Desktop.
WooCommerce: products search form using a custom template file
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 | |
$form = '<form role="search" method="get" id="searchform" action="' . esc_url( home_url( '/' ) ) . '"> | |
<div> | |
<label class="screen-reader-text" for="s">' . __( 'Search for:', 'woocommerce' ) . '</label> | |
<input type="text" value="' . get_search_query() . '" name="s" id="s" placeholder="' . __( 'My Super Search form', 'woocommerce' ) . '" /> | |
<input type="submit" id="searchsubmit" value="'. esc_attr__( 'Search', 'woocommerce' ) .'" /> | |
<input type="hidden" name="post_type" value="product" /> | |
</div> | |
</form>'; | |
echo $form; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I want to add 2 text field on product search form. Use he following code, where second text field name will be define and use AND condition.