How to Add a Search Bar in wordpress blog
How to Add a Search Bar in wordpress blog ? The answer is here . This code will be helpful for theme developers and for those who like to add search to their wordpress blog . Follow the below steps and your Blog search will be ready in 5 minutes .
1] Create a New PHP file named ” searchform.php “
2] Add the following code :
<form method=”get” id=”searchform” action=”<?php bloginfo(‘home’); ?>/”>
<div><input type=”text” size=”18″ value=” ” name=”s” id=”s” />
<input type=”submit” id=”searchsubmit” value=”Search” class=”btn” />
</div>
</form>
3] Save the above code in searchform.php , and upload it to your Theme Folder .
4] Now include , <?php include (TEMPLATEPATH . ‘/searchform.php’); ?> , where ever you like in your theme .
Preview :
Related Posts :
26 Comments
Trackbacks/Pingbacks
- file folder | Digg hot tags - [...] Vote How to Add a Search Bar in wordpress blog [...]
- Start The Loop » How to Insert Search Box in Wordpress Blog | Rockstar template - [...] How to Insert Search Box in WordPress Blog | Rockstar template. [...]








Nice post!
What do you think of Google site search (“custom search engine”)?
I’ve found it to be easy to install… you can see how it works on my site– and how it fits in with the 404 page (such as http://www.nooozeguy.com/fialkoff for instance).
Thanks,
-Josh
Awesome site, I am going to read more of your posts soon.
Thanks for the great tut!
Very simple and easy to implement. I might add that you can easily style the output by adding a class or ID to the div tag.
I’m definitely using this on my site!
Thanks for your post.
my site has a problem, when I or other person search, you don´t get results. it happens with all themes.
The site is in other language but the error is easy to see.
do you have any tip to resolve this kind of problem?
site: http://www.apostei.net
Thanks in advance
<form method=”get” id=”searchform” action=”/”>
Hi
I’m way too new to this
What above text do I modify per direction/pages from my site?
I would like to insert a search bar at
http://www.thewantlist.ca/collectors/
I want the bar to search pages on my site – ie – a user types in “Parkies” or “1951-52″ and they get the following page:
http://www.thewantlist.ca/hk19512_parkhurst/
Thank you
Richard Scott
Great info, very easy to implement. See how it looks in my travel blog maitravelsite.com
Note to all Newbees. When I copied the script above into DreamWeaver the quotes came in as quotes and not Inch marks. A subtle difference to us but a big dif to your computer.
To fix it do a search and replace for all quotes (“opening and closing”)
replace with ”
Same goes for single ‘quotes’ replace with ‘
then it works like a charm ; )
Use the same html markup but its easier just to call the form with:
Ah stripped, here we go:
get_search_form();
Can i use this as align centered?
molto bene !grazie!
Didn’t work for me!
Just to let you know I found the answer!
you must use the attribute and then create a custom searchform.php file
Just to let you know I found the answer!
you must use the (no space between the brackets) and then create a custom searchform.php file
web marketing is on the rise these days, almost everyone uses the internet to market their products and services ‘
web marketing would be the next trend in advertising. there are millions of potential costumers on the internet -~~
The first line:
<form method=”get” id=”searchform” action=”/”>
I think it should be
<form method=”get” id=”searchform” action=””/>
Great snippet otherwise. Thanks!
What I want to know is why I should care? I mean, not to say that what youve got to say isnt important, but I mean, its so generic. Everyones talking about this man. Give us something more, something that we can get behind so we can feel as passionately about it as you do.
I’ll gear this review to 2 types of people: current Zune owners who are considering an upgrade, and people trying to decide between a Zune and an iPod. (There are other players worth considering out there, like the Sony Walkman X, but I hope this gives you enough info to make an informed decision of the Zune vs players other than the iPod line as well.)
You sure do know what youre talking about. Man, this blog is just great! I cant wait to read more of what youve got to say. Im really happy that I came across this when I did because I was really starting to get bored with the whole blogging scene. Youve turned me around, man!
Sorry for the huge review, but I’m really loving the new Zune, and hope this, as well as the excellent reviews some other people have written, will help you decide if it’s the right choice for you.
Nice post. I am looking for this article. Thank you very much !
Thank. I didn’t like wp default search widget…
What is up, good site. I enjoy your design and style. I simply ended cosmetic classes and wish to start-up my blog. Thanks for the great post!
Does the google-custom-search option tie to any form of anlatyics? If not, are there any plugins that create search bars that have a back end analytics to see what people are searching for?
Great resource, thanks.