Friday, 21 March 2008

Custom search engine on your Blogger template

Improve your Blogger template adding search form.


I found this code on http://blogger-templates.blogspot.com but I received some emails from other people who said me the original code it's their. I'll add other credits in the comments of this post.

Today I received many questions about how to add the same search engine form I added on my Blogger Template. You only have to add these lines of code on your template changing the form action URL with the URL of your site:

<form action='http://yoursite.blogspot.com/search' method='get'>
<input name='q' size='24' type='text'/>
<input name='submit' type='submit' value='search'/>
<input name='max-results' type='hidden' value='4'/>
</form>

The input hidden field "max results" set the number of results you want to display on your page after a search.

<input name='max-results' type='hidden' value='4'/>

I set it to 4 but you can change it how you prefer. I suggest don't use a number greater than 10 post for page otherwise the results page will be loaded slowly.


Related Content
Some Blogger Tips you probably don't know
Blogger Hack: add social buttons to increase your traffic

No comments:

Post a Comment