Advertisement
Guest User

searchform.php

a guest
Feb 14th, 2013
150
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.76 KB | None | 0 0
  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>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement