In order to display search form on your theme, either you can use search widget on your sidebar, or you can add it manually using PHP template below:

<?php get_search_form( $echo ); ?>

Default WordPress Search Template

If you have a searchform.php in your theme folder, this template displays the contents of that file. If you don’t WordPress displays the default search template. Below you can find contents of the default search template for WordPress as provided in WordPress 4.1:

<form role="search" method="get" id="searchform" class="searchform" action="<?php echo esc_url( home_url( '/' ) ); ?>">
  <div>
    <label class="screen-reader-text" for="s"><?php _x( 'Search for:', 'label' ); ?></label>
    <input type="text" value="<?php echo get_search_query(); ?>" name="s" id="s" />
    <input type="submit" id="searchsubmit" value="<?php echo esc_attr_x( 'Search', 'submit button' ); ?>" />
  </div>
</form>

Comments (0)

Leave a Reply

Your email address will not be published. Required fields are marked *