Skip to content

Instantly share code, notes, and snippets.

@lunaroja
Created December 11, 2013 01:28
Show Gist options
  • Save lunaroja/7903603 to your computer and use it in GitHub Desktop.
Save lunaroja/7903603 to your computer and use it in GitHub Desktop.
Switch out WordPress Search for Google Domain Search
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