Adding New Fields
Available Fields Breakdown
Drag the Available Fields into the Search Form UI to build your search form.
- Search – Add a search box to your forms – this works like WP search and by default Searches in Title and Body content – to allow extend the functionality of this box install the Relevanssi plugin.
- Tag, Category, Taxonomy – Add a dropdown, checkbox, multiselect or radio buttons to your Search form
- Post Type – Add a dropdown, checkbox, multiselect or radio buttons to your Search form
- Post Date – Choose a date picker or date range (with picker) to filter results according to Publish date
- Post Meta (Custom Fields) – Search your post meta – supports number ranges, choice inputs (dropdown, checkbox, multiselect or radio) or dates and date ranges
- Author – Add a dropdown, checkbox, multiselect or radio buttons to your Search form
- Sort Order – Add a dropdown for your users to change the ordering of results
- Submit Button
- Reset Button
Note: Some Restrictions
You can only add most fields once to your form – duplicates of fields will cause errors on the frontend.
Only Taxonomy and Post Meta fields can be added to the Search Form multiple times, however for Taxonomies, each Taxonomy type may only be used once, and for Post Meta, each Meta Key may only be used once within a Search Form (Search Form UI).
Creating More Fields
Search & Filter uses the existing data within your site to build the Search Form & its fields, so in order to use more Taxonomy or Post Meta fields, you must add more Taxonomies or Post Meta data to your site.
Creating New Taxonomies
The easiest way to add new taxonomies to your site is to use a plugin – one that we use regularly is CPT UI which amongst other things allows you to create custom taxonomies easily for any post type in your environment.
Alternatively this can be done simply by adding code to your functions.php using the Register Taxonomy WordPress function
Adding Post Meta / Custom Fields
There are many uses for Post Meta – essentially this just stores additional data about a post which S&F can make searchable.
The easiest way would be to use a plugin such as Advanced Custom Fields or alternatively you could do this programmatically.
* Note – custom fields will not show up in your search form, until you add the custom field data to your posts.