Updated on September 06, 2016
This article provides the code for replacing the standard Genesis search form with a category-specific form on category archives which limits search results to Posts in current category and its sub categories.
A search widget placed in Primary Sidebar, for example, may appear like this (with some customization covered below) on most pages:
On category archive pages we are going to set it up like this:
Doing a search in the above will show search results that are only limited to the entries of the current category and its child categories.
Step 1
Add the following in child theme's functions.php:
To view the full content, please sign up for the membership.
Already a member? Log in below or here.
Hi Sridhar, I want to have full site search box on header while category search box inside category.php. Please tell me how can i exclude the header search box from this tutorial. Thanks
Can you elaborate?
Yes Sridhar, Actually I want to have one widget in header right sidebar and sometimes there is a widget in a page or sidebar…What i want that Header widget always search the whole site, and Category or page widgets only searches for the category.
You got my point. Header Search widget will search all site and sidebar widget will be category specific.