Grid Filter
Updated 2 weeks ago
Grid Filter element allows filtering items of a Grid element by multiple values such as taxonomies (categories, tags, product attributes, etc.) and posts custom fields.
Differences compared to the List Filter #
Features of Grid Filter element not yet available in the List Filter #
- Supports horizontal layout with the "Switch" type filters
- Allows showing the dynamically changing amount of relevant items while filtering
- Allows hiding unavailable values while filtering
- Supports color swatches for the relevant product attribute
- Allows targeting a specific Grid on the page to filter
Features of the List Filter element not available in the Grid Filter #
- Allows to show only specific taxonomy terms for filtering (include/exclude, show children, etc.)
- Allows filtering by post type
- Allows filtering by post author
- Allows filtering by publication date
- Allows filtering by date of update
- Allows filtering by WooCommerce product stock status
- Allows filtering by WooCommerce product "onsale" status
- Allows filtering by WooCommerce product "featured" status
- Allows filtering by ACF custom fields with Text, True/False, Date picker, Date & Time pickler types
- Allows adding the search field within a filter to narrow choices (checkboxes or radio buttons)
- Allows filtering by custom parameters via PHP hooks
About Grid Filter #
Grid Filter settings include 5 types of filter items:
- Checkboxes that support:
- Taxonomies
- Select ACF type
- Checkbox ACF type
- Radio button ACF type
- Button group ACF type
- Dropdown that supports:
- Taxonomies
- Select ACF type
- Checkbox ACF type
- Radio button ACF type
- Button group ACF type
- Radio buttons that support:
- Taxonomies
- Select ACF type
- Checkbox ACF type
- Radio button ACF type
- Button group ACF type
- Number range that supports:
- Price field of WooCommerce products
- Number ACF type
- Number range ACF type
- Select ACF type
- Radio button ACF type
- Button group ACF type
- Range slider that supports:
- Price field of WooCommerce products
- Number ACF type
- Number range ACF type
- Select ACF type
- Radio button ACF type
- Button group ACF type
Grid Filter can filter only Grids showing posts (with any post type), Grids showing terms are not available for filtering at the moment.
When filtering, the Grid Filter element always adds query strings to the current page URL (check your browser's address bar). This allows you to share links with the filter applied. Therefore:
Only one Grid Filter element can work on a page.
Grid Filter can't work if there is no Grid element on a page. In that case, Grid Filter will show the "Nothing to filter" message.
Grid Filter on regular pages #
By default, the Grid Filter will be applied to the first Grid element inside page content, including a Page Template (if set) and Reusable Blocks (if used). Grid elements inside a Reusable Block used in Menus dropdowns cannot be available for filtering.
Impreza version 8.15 came with the new ability to assign a Grid element for filtering by Grid Filter:
When you set a custom selector (class or ID), the Grid Filter element will be applied to Grid elements with such selector:
Using a class as a custom selector allows filtering several Grids by one Grid Filter element. Note that ID can't be the same for different elements on the same page.
Grid Filter on Archive pages #
By default, the Grid Filter will be applied to every Grid element showing Items of the current query.
Grids showing values other than the "Items of the current query" can't be filtered on archive pages, and they will be ignored by the Grid Filter element disregarding its settings.
Temporary fallback (will be removed in further Impreza versions): if the Page Template set for archives doesn't have a Grid showing Items of the current query, then Grid Filter will work like on regular pages (will filter the first Grid or Grids specified by the selector in settings).
Grid Filter on the Search Results page #
Grid Filter will be applied to every Grid element showing Items of the current query.
Grids showing values other than the "Items of the current query" can't be filtered on the Search Results page, and they will be ignored by the Grid Filter element disregarding its settings.