<!-- Create or edit "searchform.php" in theme folder
Replace what is there with the google cse script - example below
**Note: You will need to edit the final line outside the script with the custom parameters: resultsUrl & queryParameterName
-->
<script>
(function() {
var cx = '007001040030262277022:mmdp7u94c6u';
var gcse = document.createElement('script');
gcse.type = 'text/javascript';
gcse.async = true;
gcse.src = 'https://cse.google.com/cse.js?cx=' + cx;
var s = document.getElementsByTagName('script')[0];
s.parentNode.insertBefore(gcse, s);
})();
</script>
<gcse:searchbox-only resultsUrl="/" queryParameterName="s"></gcse:searchbox-only>
<!-- now find or create search.php in your theme to create a results page, then include the code below -->
<gcse:searchresults-only queryParameterName="s"></gcse:searchresluts-only>
<!-- I also like to use the following php snippet for the page title for a custom header -->
<h1><?php printf( __( 'Search Results for: %s', 'betfirm' ), '<span>' . get_search_query() . '</span>' ); ?></h1>
<!-- Now I can reference <?php get_search_form(); ?> anywhere in my theme and keep the results on the default wordpress search results page-->