Want more features on Pastebin? Sign Up, it's FREE!
Guest

searchform.php

By: a guest on Feb 14th, 2013  |  syntax: PHP  |  size: 0.76 KB  |  views: 82  |  expires: Never
download  |  raw  |  embed  |  report abuse  |  print
Text below is selected. Please press Ctrl+C to copy to your clipboard. (⌘+C on Mac)
  1. <?php $search_box_default = __( 'Search...', 'it-l10n-BuilderChild-Default' ); ?>
  2.  
  3. <?php $search_box_value = esc_attr( apply_filters( 'the_search_query', get_search_query() ) ); ?>
  4.  
  5. <?php $search_box_value = ( empty( $search_box_value ) ) ? $search_box_default : $search_box_value; ?>
  6.  
  7. <form method="get" class="search-form" action="<?php echo get_option( 'home' ); ?>">
  8.     <input type="text" value="<?php echo $search_box_value; ?>" name="s" class="search-text-box" onfocus="if(this.value == '<?php echo $search_box_default; ?>') this.value = '';" onblur="if(this.value == '') this.value = '<?php echo $search_box_default; ?>';" />
  9.     <input type="submit" value="<?php echo esc_attr__( 'Search', 'it-l10n-BuilderChild-Default' ); ?>" class="search-submit-button" />
  10. </form>
clone this paste RAW Paste Data