This is the new temporary home of all things related to the free version of Search & Filter – the one found on wordpress.org.
This version works via shortcodes only – no admin UI.
We’re currently updating both free and pro editions with version 3.0 – check out this blog post for more information and to get involved with testing.
Looking for more features?
Including custom fields, drag and drop admin UI, ajax search + much more.
Table of contents
Get Search & Filter free edition
The fastest way to get Search & Filter is simply to search for the plugin by going to the `plugins` section in the WordPress admin of your installation, selecting `add new` and searching for `Search & Filter`. Otherwise head over to the Search & Filter on the WordPress Plugins repo and download from there.
The quickest installation is via the WordPress admin section of your site, alternatively grab a download before proceeding
Via WordPress Admin: Head to the `Plugins` menu, select `add new` and search for `Search & Filter`. Ensure the plugin is by `Designs & Code` and press `Install Now`.
– OR -Via Download: Upload the entire `search-filter` folder to the `/wp-content/plugins/` directory. Activate the plugin through the `Plugins` menu in WordPress.
How To Use
Search & Filter free works as a WordPress shortcode so it’s as simple as configuring the shortcode and setting your preferences!
As a Shortcode
At its most basic implementation it looks like this:
In a Theme File
To use this within a theme file you simple need to call the `do_shorcode` function with the shortcode above:
<?php echo do_shortcode('[searchandfilter fields="search,category,post_tag"]'); ?>
You can use any combination of these in your shortcodes, the only required option is `fields`.
|Comma seperated list of any field names and Public Taxonomies:search|
*public taxonomy names
|Fields will be display in the order shown|
|select||Comma seperated list of any of the types found below:|
These types should only be used when the field is `post_date`:date
|Order of `types` will match order of fields|
|Comma seperated list containing any string value. Blank values are ommited completely and the label will not display.||Order of `headings` will match order of fields|
|0||Comma seperated list.|
1 – display as hierarchical
* any other value is ignored
|Order of `hierarchical` will match order of fields|
|1||Comma seperated list.|
0 – Shows empty taxonomies
1 – Hides empty taxonomies
*Any other value is ignored
|Order of `hide_empty` will match order of fields|
|name||Comma seperated list of the following possible values:|
This uses the values of “orderby” as defined on the WordPress site.
|Order of `order_by` will match order of fields|
|ASC||Comma seperated list containing:|
ASC – ascending
DESC – descending
This sets the order of taxonomies terms for a given taxonomy and can be used in conjunction with `order_by`.
|Order of `order_dir` will match order of fields|
|Comma seperated list containing any string value. Leaving blank for a field will revert to default behaviour.||This is the placeholder text that appears when choosing to search “all” of a term – ie an unfiltered search.When using a select drop down for example this is the text that appears in the first position in the dropdown – ie – “All Categories”Order of `all_items_labels` will match order of fields|
|0||Comma seperated list containing:|
0 – Hide count
1 – Show count
* any other value is ignored
|This shows the number of posts/items within a taxonomy term in brackets after the term.Example:Oranges (10)|
|AND||Comma seperated list containing:|
AND – results shown must be IN ALL terms
OR – results shown can be IN ANY of the terms
|The operator used when selecting multiple terms. This only applies when using multiple select inputs such as checkbox or multiselect.Order of `operators` will match order of fields|
|Comma seperated list of all post types for filtering, or simply set to `all` to include all post types.||This can be used with or without `post_type` appearing in the field list.When `post_type` appears in the field list, the post types listed here will be selectable in the `post_type` field.When `post_type` does not appear in the field list, then all searches are retricted to the post types here.|
|Any string||Enter a class name here to add it to the Search & Filter form.Ommit to ignore.|
|Submit||Any string||This is the text label on the submit button.|
|Search …||Any string||This is the placeholder text that appears when no search term has been entered in the search field|
|Any URL or ommit for default behaviour||When a users submits the search form without any search preferences selected (a blank search) they will be redirected to this URL|
|0||Can be a value of `1` or `0` for true or false||Setting to true will force a “?s=” or “&s=” to be added to the url even when the search is blank – this may help with the loading of search templates in some themes|
Minimal with `Category` and `Post Tag` as dropdowns
Headings for Categories and Tags
Notes: Label omitted for the `search` field
[searchandfilter fields="search,category,post_tag" headings=",Categories,Tags"]
Change the submit button label
Notes: `search` field omitted
[searchandfilter fields="category,post_tag" submit_label="Filter" headings="Categories,Tags"]
Custom taxonomies as dropdowns
Radio buttons and headings
[searchandfilter fields="search,category,post_tag" types=",radio,radio" headings=",Categories,Tags"]
Checkboxes and headings
[searchandfilter fields="search,category,post_tag" types=",checkbox,checkbox" headings=",Categories,Tags"]
Minimal with Post Date
[searchandfilter fields="search,post_date" types=",date" headings=",Post Date"]
Minimal with Post Date Range
[searchandfilter fields="search,post_date" types=",daterange" headings=",Post Date"]
Minimal with Post Types
[searchandfilter fields="search,post_types" post_types="post,page" headings=",Post Types"]
Using `order_by` and `order_dir`
Notes: Categories are ordered by ID, ASC and Tags are ordered by NAME, DESC
[searchandfilter fields="search,category,post_tag" order_dir=",asc,desc" order_by=",id,name" types=",checkbox,radio" headings=",Categories,Tags"]
[searchandfilter fields="search,category" types=",checkbox" hierarchical=",1" headings=",Categories"]
Putting it all together
[searchandfilter fields="search,category,post_tag,post_format,taxonomyone,taxonomytwo" types=",radio,checkbox,select,radio,select" hierarchical=",1" headings=",Categories,Tags,Post Format,Taxonomy One,Taxonomy Two" submit_label="Filter"]
- WARNING – this update includes some major changes to shortcode construction, do not upgrade until you have read how this will affect your setup – updating should be easy.
- Renamed the `taxonomies` argument to `fields` – `taxonomies` is now no longer appropriate as this list contains field types other than taxonomies – this list now contains taxonomies, `post_type`, `post_date` and `search` – `taxonomies` as an argument is still supported however will be deprecated
- Search box can now be positioned anywhere, simply include `search` in the fields list in the position desired. Upgrading from previous versions will cause you to lose your search box, simply include `search` in the fields list to show it again
- Drop support for `search` argument as no longer relevant – control display of search input by adding it to the `fields` list
- Labels have been completely rewritten – `label` has been renamed to `headings` to avoid confusion with internal taxonomy labels – the `headings` argument now allows for any text to be added and displayed as a heading for each field – this allows for much more flexibility and no longer uses internal taxonomy labels – to hide a label simply leave blank
- Added support for hierarchical taxonomies for all input types – checkbox, radio & select
- Added support for ordering of taxonomies – use `order_by` argument – allowed values are `id`, `name`, `slug`, `count`, `term_group`
- Added support for ordering direction of taxonomies – use `order_dir` argument – allowed values are ‘asc’ or ‘desc’
- Added support to show or hide empty taxonomies – use `hide_empty` argument
- Added support for `search_placeholder`
- Updated `post_date` functionality to work with older versions of WP – can be displayed either as `date` or `daterange` – the `post_date` field uses the HTML 5 input type of `date` – browsers that do not support it will simply show a text box – a tutorial of integrating jquery for graceful degredation is in the works
- Renamed `submitlabel` to `submit_label` – `submitlabel` still works for now.
- Renamed `type` to `types` – `type` still works for now.
- Updated display of checkboxes and radio buttons, inputs are now wrapped in an unordered list which may affect your styling
- Various bug fixes
- Thanks to `bradaric` for help with hierarchical dropdown lists and date input types – https://github.com/bradaric
- Added support for post_date to be displayed either as date or daterange (WP 3.7+) type
- Added support for all public and custom post types (the attachment post type is excluded) – all post types can be user searchable or predfined and hidden from the user. This allows for users to add multiple search widgets to their site which work on specific post types independantly from eachother.
- Added offical updated documentation (this document), created and moved to Search & Filter Docs
- Fixed: when submitting an empty search/filter, “?s=” now gets appended to the url (an empty search) to force load a results page, previously this was redirecting to the homepage which does not work for many use cases
- Added support for checkboxes and radio buttons, with the option to control this for each individual taxonomy.
- Added support to show or hide headings for each individual taxonomy.
- Added support to pass a class name through to Search & Filter widgets, this allows styling of different instances of Search & Filter
- Fixed problems with escaping output in search box
- Notice: This update will automatically add headings to taxonomy dropdowns, refer to usage and examples on how to disable them.
- Added some documention & screenshots to plugin page
- Version bump for WordPress plugins site
- Updated to use
label->all_itemsin taxonomy object for dropdowns before using
- Notice: This update may cause some labels/headings to break, ensure you have set up your taxonomy properly including setting
- Initial Release