Custom Search In WordPress For A Specific/Limited Category

Add this code where you want to put the custom search.

Settings :
action – set the site url
cat field value – should be set to the category id whatever you want to search in(here its 5)

<form method="get" id="search form" action="http://localhost/wordpress_test/">
<div>
<input type="text" value="" name="s" id="s" />
<input type="hidden" value="5" name="cat" id="scat" />
<input type="submit" value="search"/>
</div>
</form>

Yeah ! Simple as that. Try it out.

Loading

Leave A Comment

Your email address will not be published. Required fields are marked *

This site uses Akismet to reduce spam. Learn how your comment data is processed.