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 :




















[...] Vote How to Add a Search Bar in wordpress blog [...]
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!
[...] How to Insert Search Box in WordPress Blog | Rockstar template. [...]