Created
December 11, 2013 01:28
-
-
Save lunaroja/7903603 to your computer and use it in GitHub Desktop.
Switch out WordPress Search for Google Domain Search
This file contains hidden or 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
if ( ! function_exists( 'google_search_form' ) ) : | |
function google_search_form( $form ) { | |
$form = '<form method="get" action="http://www.google.com/search" class="search">'; | |
$form .= '<input type="hidden" name="domains" value="' . get_bloginfo('url') . '">'; | |
$form .= '<input type="hidden" name="sitesearch" value="' . get_bloginfo('url') . '">'; | |
$form .= '<input type="text" name="q" placeholder="Search" class="input">'; | |
$form .= '<input type="submit" value="Submit" class="submit">'; | |
$form .= '</form>'; | |
return $form; | |
} | |
add_filter('get_search_form','google_search_form'); | |
endif; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment