Search form for wordpress boostrap based theme

As I create a boostrap based theme for bootstrap despite why-bootstrap-is-a-bad-fit-for-wordpress-themes, I wanted to have a search form that fits well. creating-bootstrap-wordpress-theme-search, and enhanced for Boostrap 3.2, here is my searchform.php

<?php $search_terms = htmlspecialchars( $_GET["s"] ); ?>

<form role="form" action="<?php bloginfo('siteurl'); ?>/"
  id="searchform" method="get">
  <label for="s" class="sr-only">Search</label>
  <div class="input-group">
    <input type="text" class="form-control" id="s" name="s"
      <?php if ( $search_terms !== '' ) { echo ' value="' . $search_terms . '"'; } ?> />
    <span class="input-group-btn">
      <button type="submit" class="btn btn-primary">
        <i class="glyphicon glyphicon-search"></i>
  <!-- .input-group -->

Popular posts from this blog

Simple Samba setup on Lubuntu

Soving AccessDenied on Google Cloud Storage domain mapping

USB Foot Switch II - "Usb HIDKB Not connected"