Skip to content

Instantly share code, notes, and snippets.

@greghunt
Created February 26, 2016 22:15
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save greghunt/4e4a2fa26a0d43bdd8a2 to your computer and use it in GitHub Desktop.
Save greghunt/4e4a2fa26a0d43bdd8a2 to your computer and use it in GitHub Desktop.
Wordpress HTML5 Bootstrap search form
<form role="search" method="get" class="search-form" action="<?php echo home_url( '/' ); ?>">
<label for="searchField" class="screen-reader-text"><?php echo _x( 'Search for:', 'label' ) ?></label>
<div class="input-group">
<input type="search" id="searchField" class="search-field"
placeholder="<?php echo esc_attr_x( 'Search the site for…', 'placeholder' ) ?>"
value="<?php echo get_search_query() ?>" name="s"
title="<?php echo esc_attr_x( 'Search for:', 'label' ) ?>" />
<span class="input-group-btn">
<button type="submit" class="btn btn-default">
<?php echo esc_attr_x( 'Search', 'submit button' ) ?>
</button>
</span>
</div>
</form>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment