Monday, 29 September 2008

Add a search box to your blogger site

In a previous post I showed how to remove the blogger navbar from the top of your blog. While this may help with the design and look of your site it does create one problem … you no longer have a means of directly searching the site. D’oh!

To add a basic search box to your site place the following code in your template where you would like it to appear -
<form action='http://www.google.com/search' method='get'>
<input name='sitesearch' type='hidden' value='yoursite.blogspot.com'/>
<input maxlength='255' name='q' size='18' type='text' value=' Search the site'/>
<input name='submit' type='submit' value='Go'/>
</form>
Remember to change the value='yoursite.blogspot.com' to the name of your blog. If your site is new you won’t get search results until you’ve had a visit from Google’s spiders, after which it should work fine. Well, I hope so …

0 comments: