- No categories
- All
How to Use Multiple Search Forms In WordPress
Recently we showed you how to limit search results for specific post types in WordPress . Now we are going to show you how you can create different/multiple search forms altogether. This way each form can be limited to searching for a specific post type. Although this isn’t very hard it will require you to have a basic understanding of WordPress templates. First, you will need some search forms. Place the following code wherever you want them to be in your blog: <form method="get" id="searchform" action="<?php bloginfo('home'); ?>/"> <input type="text" value="" name="s" id="s" /> <input type="hidden" name="search-type" value="normal" /> <input name="submit" type="submit" value="Go" /> </form> In order to specify what sort of search this form will be doing, just change the value of the hidden field. Right now it is set to “normal” but it can be anything you want. Next, we need to modify the search.php file. Open it up and replace everything in … [Read more...] about How to Use Multiple Search Forms In WordPress
Learn More