<div class="iblogs-widget <?php echo $css_class; ?>">
  <?php if ($widget_heading) { ?>
    <h3 class="iblogs-line-title iblogs-widget-heading"><?php echo $widget_heading; ?></h3>
  <?php } ?>

  <div id="iblog-search" class="input-group">
    <input type="text" name="iblogs_search" value="<?php echo $search; ?>" placeholder="<?php echo $placeholder; ?>" class="form-control iblogs-search">
    <span class="input-group-btn">
      <button type="button" class="btn btn-default"><i class="fa fa-search"></i></button>
    </span>
  </div>

<script>
$(document).ready(function() {
  $('.iblogs-search').parent().find('button').on('click', function() {
    var url   = '<?php echo $url_search; ?>',
        value = $('.iblogs-search').val();

    if (value) {
      url += '&search=' + encodeURIComponent(value);
    }
    location = url;
  });

  $('.iblogs-search').on('keydown', function(e) {
    if (e.keyCode == 13) {
      $('.iblogs-search').parent().find('button').trigger('click');
    }
  });
});
</script>

<?php if (!empty($custom_css)) { ?>
<style>
  <?php echo $custom_css; ?>
</style>
<?php } ?>
</div>
