Thursday, 2 December 2010

NerveJam.Com : replaced built-in search system with Google Search

NerveJam.Com was the only one of my sites where the search box was not actually an easily-replaced widget.
Turns out that the search box was hard-coded into the header.php file.

Generated a custom Google (Adsense) Search engine for this site only, with results to appear on a local page.
Simply replaced the search code in the header code with Google's (Adsense) generated code, added a "Search Results" page, and pasted Google's (Adsense)target code into it. Bit of tweaking later, and that's it.

Why bother? Monetization.... :)
P.S. this will only work if your site is indexed by Google. Otherwise you get no results..

No comments:

Post a Comment