Skip to content

Instantly share code, notes, and snippets.

@MrJSdev
Created March 26, 2018 07:02
Show Gist options
  • Save MrJSdev/3c1b7a61d0cbdc126b1f3a70549de8b5 to your computer and use it in GitHub Desktop.
Save MrJSdev/3c1b7a61d0cbdc126b1f3a70549de8b5 to your computer and use it in GitHub Desktop.
<form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>">
<div class="form-group">
<div class="input-group">
<input type="search" class="form-control form-input"
placeholder="<?php echo esc_attr_x( 'Search for T-Shirts…', 'placeholder' ) ?>"
value="<?php echo get_search_query() ?>" name="s"
title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
<input type="hidden" name="post_type" value="t-shirts" /> <!-- Change value from "t-shirts" to whatever your custom post type name -->
<div class="input-group-addon"><button class="form-btn" ><i class="fa fa-search" aria-hidden="true"></i></button></div>
</div>
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment