The Directory WordPress theme offers a plethora of widgets that offer different functionalities. These widgets can be placed at the different widget areas to avail different functions. Here, we will discuss the Advanced search widget available with the Directory platform.
Advanced Search widget
Basically, Directory is used to create a location-based listings website. This means that a it will possibly have extensive data. To make it easy to search through this data, there is an Advanced Search Widget.
What differentiates it from other search widget is that it lets the user specify more than one search criteria and thereby fetch more filtered results.
How it works?
This widget can be easily managed from the back-end of your WordPress site.
Title: Set the title you want to be displayed for the widget
Post type : All the inbuilt as well as the custom post type will appear in this drop-down. For example : Posts, listings, jobs, events, deals, etc. Select the one you want.
Search fields : This is the main part of the widget from where you can add the search criteria. Selecting an option will add a search filled to the advanced search widget.
How it appears on the front end?
Choose the widget area you want to place it into. The widget works well in any widget area it is placed in but suits best in sidebars. This is how the advanced search widget look on the front end, when placed in a page’s sidebar area.
Highlights of the advanced search
- Can be used at various widget areas
- Set the widget title to make it more intuitive
- Add search fields according to your desire
Suppose, the Directory theme is used to create an online portal of the education institutes of India. It lists all the leading schools and collages and contains a large number of listings. For the users of your website, searching for a particular institute becomes tiresome. Example: A students want to search for a “private college” , which offers the “Civil engineering” course and is affiliated to “Pune University” . Even the category wise results will not help.
So you can provide your users with an advanced search widget with the required criteria that can make their task easy. This will reduce the user’s efforts to reach a desired listing and therefore enhance the user experience.
How to use custom fields in advanced search on your directory theme?
The advanced search page template is basically useful if we want to provide multiple search criteria for the front end visitors. We can provide those search options in the form of certain custom fields which can be created from wp-admin >> Tevolution >> Custom fields module.
- Apart from some of the default custom fields, we can also add additional custom fields as per the current site requirement.
- Now in order to create advanced search page, Go to your wp-admin >> Pages >> Create a new page along with the appropriate title. You can also add description text.
- Choose Template as “Advanced search” from the page attribute shown at the sidebar container.
- Save all the changes.
- Now go to your wp-admin >>Appearance >> Widgets >> Drag a widget “T → Advanced Search” to the “Advance Search Content ” widget area and choose your required post type.
- We can insert multiple custom fields along with the appropriate field type for that widget setting.
- See the screenshot below:
So, basically in the Advanced Searchwidget you can build your search form according to your requirement by adding or removing fields in the form.