How to Add a Search Bar in wordpress blog

submit to reddit

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 :