Last active
December 25, 2015 07:19
-
-
Save rickrduncan/6938507 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
//* Do NOT include the opening php tag above | |
/** | |
* Alter the Genesis Search form so that we can change the destination page | |
* and our querystring parameter. | |
* | |
* @author Rick R. Duncan | |
* @link http://www.rickrduncan.com | |
*/ | |
function b3m_search_form( $form, $search_text, $button_text, $label ) { | |
$onfocus = " onfocus=\"if (this.value == '$search_text') {this.value = '';}\""; | |
$onblur = " onblur=\"if (this.value == '') {this.value = '$search_text';}\""; | |
$form = '<form method="get" class="searchform search-form" action="' . home_url() . '/search" >' . $label . ' | |
<input type="search" value="' . esc_attr( $search_text ) . '" name="q" class="s search-input"' . $onfocus . $onblur . ' /> | |
<input type="submit" value="' . esc_attr( $button_text ) . '" /> | |
</form>'; | |
return $form; | |
} | |
add_filter( 'genesis_search_form', 'b3m_search_form', 10, 4); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment