WordPress
patterns/filter-for-terms-static.php
✔ Custom
- Use: a list visitors should narrow down by topic, for example downloads or references.
- Not for very short lists, where filtering is more work than reading, and not for lists so large that they should be filtered dynamically from the database.
- Source: entries and terms entered by hand.
- Content: a heading and an optional subline; 6 or more entries, each a title and the terms it is filtered by.
patterns/filter-1-dynamic.php
✔ Custom
- Use: filtering a post type by one taxonomy, each term a single click away.
- Not for several taxonomies, and not for long term lists, which wrap into many rows of buttons.
- Source: the posts of the query, filtered by the Filter plugin.
- Content: a heading that names what visitors can filter; every post needs a landscape featured image in the same ratio as the others, since the teaser does not crop it, a hand-written excerpt, a category and tags; the query sets how many appear and the grid how many columns; one taxonomy of up to about ten terms with short names. Set the post type and taxonomy before publishing; until then it stays empty.
This pattern contains dynamic content and may be displayed incompletely in the live preview. Check the figma-preview to get a feeling how it looks with real content.
patterns/filter-2-dynamic.php
✔ Custom
- Use: filtering a post type by several taxonomies that visitors usually use one at a time, so only one of them is in view at once.
- Not when visitors combine taxonomies and should see every selection together.
- Source: the posts of the query, filtered by the Filter plugin.
- Content: a heading that names what visitors can filter; every post needs a landscape featured image in the same ratio as the others, since the teaser does not crop it, a hand-written excerpt, a category and tags; the query sets how many appear and the grid how many columns; two to four taxonomies with short term lists, and tabs renamed after them. Set the post type and taxonomies before publishing; until then it stays empty.
This pattern contains dynamic content and may be displayed incompletely in the live preview. Check the figma-preview to get a feeling how it looks with real content.
patterns/filter-3-dynamic.php
✔ Custom
- Use: filtering a post type by a few taxonomies that visitors combine, with every term in view at once and a count of the posts each one leaves.
- Not for long term lists, which push the results far down the page, and not for a single taxonomy.
- Source: the posts of the query, filtered by the Filter plugin.
- Content: a heading that names what visitors can filter; every post needs a landscape featured image in the same ratio as the others, since the teaser does not crop it, a hand-written excerpt, a category and tags; the query sets how many appear and the grid how many columns; two or three taxonomies of up to about eight terms each. Set the post type and taxonomies before publishing; until then it stays empty.
This pattern contains dynamic content and may be displayed incompletely in the live preview. Check the figma-preview to get a feeling how it looks with real content.
patterns/filter-4-dynamic.php
✔ Custom
- Use: filtering a post type by several taxonomies with long term lists, each group opening on demand, while the current selection stays in view as filters to remove one by one.
- Not for short term lists, where opening a group is an extra click for nothing.
- Source: the posts of the query, filtered by the Filter plugin.
- Content: a heading that names what visitors can filter; every post needs a landscape featured image in the same ratio as the others, since the teaser does not crop it, a hand-written excerpt, a category and tags; the query sets how many appear and the grid how many columns; three or more taxonomies with many terms each. Set the post type and taxonomies before publishing; until then it stays empty.
This pattern contains dynamic content and may be displayed incompletely in the live preview. Check the figma-preview to get a feeling how it looks with real content.
patterns/filter-5-dynamic.php
✔ Custom
- Use: filtering a post type with a comprehensive filter of many choices that visitors see side by side with the results, mainly on desktop.
- Not when most visitors come on phones, where the column moves above the results and pushes them out of view.
- Source: the posts of the query, filtered by the Filter plugin.
- Content: a heading that names what visitors can filter; every post needs a landscape featured image in the same ratio as the others, since the teaser does not crop it, a hand-written excerpt, a category and tags; the query sets how many appear and the grid how many columns; several taxonomies with many terms each. Set the post type and taxonomies before publishing; until then it stays empty.
This pattern contains dynamic content and may be displayed incompletely in the live preview. Check the figma-preview to get a feeling how it looks with real content.
patterns/filter-6-dynamic.php
✔ Custom
- Use: filtering a post type by very many taxonomies, mainly on desktop, with the filter in a column beside the results and every group closed at first, so the taxonomies stay in overview.
- Not for a few taxonomies with short term lists, where closed groups only add clicks.
- Source: the posts of the query, filtered by the Filter plugin.
- Content: a short heading, since it sits in the narrow filter column; every post needs a landscape featured image in the same ratio as the others, since the teaser does not crop it, a hand-written excerpt, a category and tags; the query sets how many appear and the grid how many columns; very many taxonomies. Set the post type and taxonomies before publishing; until then it stays empty.
This pattern contains dynamic content and may be displayed incompletely in the live preview. Check the figma-preview to get a feeling how it looks with real content.
patterns/filter-7-dynamic.php
✔ Custom
- Use: filtering a post type by many taxonomies and terms, mainly on desktop, for content that visitors explore both as a list and on a map; the filter stays in a column beside the results and its groups start closed.
- Not for a few criteria, and not for content without locations.
- Source: the posts of the query, via the Filter and Map plugins.
- Content: a heading that names what visitors can filter; every post needs a landscape featured image in the same ratio as the others, since the teaser does not crop it, a hand-written excerpt, a category and tags and a location; the query sets how many appear and the grid how many columns; many taxonomies and terms. Set the post type and taxonomies before publishing; until then it stays empty.
This pattern contains dynamic content and may be displayed incompletely in the live preview. Check the figma-preview to get a feeling how it looks with real content.
patterns/filter-8-dynamic.php
✔ Custom
- Use: filtering content of several post types in one list, such as posts, pages and events in a site-wide overview, where visitors narrow it down by post type first and then by topic; the filter stays in a column beside the results.
- Not for a single post type, where a post type group has nothing to choose from.
- Source: the entries of several post types in one query, via the Filter and Multi Post Type Loop plugins.
- Content: a heading that names what visitors can filter; every entry needs a landscape featured image in the same ratio as the others, since the teaser does not crop it, and a hand-written excerpt, posts also a category and tags; the query sets how many appear and the grid how many columns; post types in the order visitors should see them, then taxonomies with terms. Set the post types, their order and the taxonomies before publishing.
This pattern contains dynamic content and may be displayed incompletely in the live preview. Check the figma-preview to get a feeling how it looks with real content.
Figma
Docs
- The pattern filter-for-terms-static is static: it filters entries that are already in the markup and loads nothing. For lists from the database, use the dynamic variants. They need the plugin WP Design System – Filter, and the theme offers them only while the plugin is active. filter-7-dynamic also needs the plugin WP Design System – Map, filter-8-dynamic the plugin WP Design System – Multi Post Type Loop.
- In a dynamic variant, set the post type in the Query Loop and the taxonomies in the filter’s Filter groups panel. The patterns query custom_post_type and custom-taxonomy-1 to -3 until you change them. filter-8-dynamic is a Multi Post Type Loop of posts, pages and custom_post_type instead: set its post types in the loop’s Post types panel and their order below the group Post types in the Filter groups panel. A taxonomy whose terms none of the loop’s posts carry doesn’t show.
- The filter replaces the list without reloading the page, so the Query Loop must keep Reload full page switched off; the editor offers to switch it back on. Without JavaScript the filter is a form with a submit button.
- Changes made with the keyboard wait a moment before the list updates, screen readers hear the new number of results, and the focus stays where it was.
- On small screens the filter closes behind its toggle button.
- In the static variant, the following classes must be present structurally:
.filter-container– Container element that activates the script. Each container gets its own filter instance..item– The filterable content elements within the container..filter-term– Element within an.itemwhose text content is used as the filter term.
