Home > Mobile Lifestyle > Custom Google Search with iNove

Custom Google Search with iNove

The iNove WordPress theme has the option to replace the WordPress search bar with a Custom Google Search which includes ‘Google Adsense For Serach’ support. However, if you want the search results to appear within your website rather than on googles page, you need to manually configure the theme. Here is how its done.

1. Login to your admin page and click Current Theme Options on Appearance tab.

Check Using google custom search engine tickbox and type in you CX name of your Google code inside CX textfield. For example: “partner-pub-1234567890123456:f69j39-flrj” without quotes and Save Changes.

2. Go to Editor in the Appearance tab

2.a. Edit header.php inside “templates” folder of current theme right after “<?php if($options['google_cse'] && $options['google_cse_cx']) : ?>”, change “yours” to your value.

<form action=”yours” method=”get” id=”cse-search-box”>

<div class=”content”>

<input type=”text” class=”textfield” name=”q” size=”24″ />

<input type=”hidden” name=”cof” value=”yours” />

<input type=”submit” class=”button” name=”sa” value=”" />

<input type=”hidden” name=”cx” value=”<?php echo $options['google_cse_cx']; ?>” />

<input type=”hidden” name=”ie” value=”yours” />

</div>

</form>

2.b. Edit index.php located inside root folder of current theme by placing this snippet after “<?php endif; ?>” at line 31, change “yours” to your value :

<?php if (“is_search()”) {

echo “<div id=\”cse-search-results\”></div>

<script type=\”text/javascript\”>

var googleSearchIframeName = \”cse-search-results\”;

var googleSearchFormName = \”cse-search-box\”;

var googleSearchFrameWidth = yours;

var googleSearchDomain = \”www.google.com\”;

var googleSearchPath = \”/cse\”;

</script>

<script type=\”text/javascript\” src=\”http://www.google.com/afsonline/show_afs_search.js\”></script>”;

}

?>

Test your search feature after these changes, and shoot me a note if you need further help.

Categories: Mobile Lifestyle Tags:
  1. No comments yet.
  1. No trackbacks yet.