Update Sep-06-2006: Please see Displaying Google Search Results on Your Own Page for a more complete Google SiteSearch Feature.
—–Original Post:—-
For search within a site, let's install a Google search box on the Ads Minded Wordpress theme.
First log in to your Google Adsense account, and choose Adsense setup, and from the products list, select Adsense for Search. On the next page, select WebSearch + SiteSearch, type your site or blog URL in the appropriate box, leave the search box options at their default values, except length of text box, enter the number 35 in the characters box.
Tick the box to customize the search results, Add new profile called your blog name, then leave the rest at default, and click Continue.
On the next page, select from the palettes drop down menu the Seaside palette, choose the country domain you want used for the search results. If your blog is in English and your readers are mostly from the U.S., select United States because that's where the biggest Adsense revenue comes from.
Select (or create) a channel for your search. This is important because you'll want to observe channel performance for optimizing your Adsense for Search revenue. Click continue and copy the code to clipboard.
Go to the Wordpress Theme Editor and paste the code in your index.php, single.php, and archives.php. Paste it just before the line that says
.
Remember that you can check my current functional template code by clicking on the corresponding title in the Pages box in the sidebar on the right. Look at my code, and make sure your code looks similar.
For better functionality, we'll use a html page jump feature — there's really no room for a SiteSearch box on top of the blog, so I've put it at the bottom of the page. The page jump feature will enable my readers to locate the search box easily.
The page jump functionality is achieved as follows:
Just before the search box code, above the line that says
add this line:
Now we've given a name for that point in the page. Next, we'll add the following in the sidebar, at the very top:
Now, when users click on that Search link, their browser will automatically take them to the Google SiteSearch box.
That's it, now you've got a Google SiteSearch on your site.









[…] Go to Google Adsense, select Products -> adsense for search. Select your preferred options as usual, just remember to check the Open results within my own site option. If you don’t know how to add a Google Search feature on your website, check a previous post for detailed instructions. […]