Plugins

The plugins we maintain for the Custom theme: what each one adds, how to set it up and which patterns build on it.

Table of Contents

Each plugin ships next to the themes as its own ZIP with its own version number. Install the ones a project needs under Plugins › Add New Plugin › Upload Plugin. Whether a feature belongs in the theme or in a plugin is decided under Extending.

  • Every plugin works on its own. Plugins may work together when both are active, but none requires another.
  • Every plugin uses the WordPress Abilities API. All of them offer their functions as abilities, so AI agents can configure them, and every new plugin has to as well. The abilities each plugin offers are listed in its readme.
  • Patterns stay in the theme. Patterns built on a plugin live in the Custom theme, which offers them only while the plugin is active.
  • The readme has the details. Every option, hook and constant of a plugin is described in the readme inside its ZIP.

WP Design System – Filter

Filters the posts of a Query Loop by their terms, by a search word and by sort order, without reloading the page.

What it adds

  • Filter, a block inside a Query Loop: the terms of the loop’s posts as checkboxes, radio buttons or buttons, one filter group per taxonomy, side by side, in tabs or collapsible.
  • Its parts, blocks the Filter adds and removes in its settings: search, sort order, the selected filters as removable buttons, the number of results, a reset button and a toggle button that opens and closes the filter on small screens.
  • Counts per term: each term shows how many posts it leaves; terms that would leave none are disabled.

The selection lives in the URL, so a filtered list can be shared and the back button works. Without JavaScript the filter is a form with a submit button.

Setting it up

  1. Install and activate the plugin.
  2. Insert a Filter pattern and set the post type in its Query Loop. The patterns query the post type custom_post_type and the taxonomies custom-taxonomy-1 to -3 until you change them, so on a site without them they stay empty. filter-8-dynamic queries posts, pages and custom_post_type instead: set its post types in the panel Post types of its Multi Post Type Loop, and their order in the Filter groups panel.
  3. Choose the taxonomies in the Filter’s Filter groups panel. The filter groups follow the post type you set: the pattern’s groups give way to one for each taxonomy of your post type that has terms.
  4. Keep Reload full page switched off in the Query Loop: the filter replaces the list without reloading the page. The editor offers to switch it back on.

Patterns

FamilyThemePatterns
FilterCustomfilter-1-dynamic, filter-2-dynamic, filter-3-dynamic, filter-4-dynamic, filter-5-dynamic, filter-6-dynamic, filter-7-dynamic (also needs WP Design System – Map), filter-8-dynamic (also needs WP Design System – Multi Post Type Loop)
MapCustommap-5-dynamic, together with WP Design System – Map

Works with

  • WP Design System – Map: a Query Map in the same Query Loop shows only the posts the filter leaves and updates with every change. The patterns map-5-dynamic and filter-7-dynamic combine both.
  • WP Design System – Multi Post Type Loop: in a loop with several post types, the filter can offer the post types as a filter group of their own, in an order you set. The pattern filter-8-dynamic combines both.
  • Relevanssi: when it is active, the search field searches through Relevanssi.

WP Design System – Map

Shows the posts of a Query Loop on a map and switches the loop between its list and its map.

What it adds

  • Query Map, a block inside a Query Loop: the loop’s posts on an OpenStreetMap or Google map. It follows the loop’s settings, so a filter that narrows the loop narrows the map.
  • Map toggle buttons, a block inside a Query Loop: two buttons that switch between the list and the map.
  • A Location box in the editor, for the post types chosen in the settings.
  • Settings › Maps: the post types with a location, the map service, its keys and the map style.

The plugin is made for the Custom theme: the icons of the toggle buttons, grid and location, come from it.

Setting it up

  1. Install and activate the plugin.
  2. Under Settings › Maps, choose the post types whose posts have a location. Only they get the location box.
  3. Give each post a location in that box.
  4. Insert a Map pattern and set the post type in its Query Loop. The patterns query the post type custom_post_type until you change it, so on a site without it they stay empty.

Patterns

FamilyThemePatterns
MapCustommap-1-dynamic, map-2-dynamic, map-3-dynamic, map-4-dynamic, map-5-dynamic (also needs WP Design System – Filter)
FilterCustomfilter-7-dynamic, together with WP Design System – Filter

Works with

  • WP Design System – Filter: a filter in the same Query Loop narrows the map without reloading the page; map-5-dynamic and filter-7-dynamic combine a map, a list and a filter.
  • WP Design System – Events: when Events is chosen under Settings › Maps, events take their location from their venues and get no location box of their own. Without the Events plugin nothing changes.
  • WP Design System – Multi Post Type Loop: a Query Map inside a Multi Post Type Loop shows the posts of all its post types that have a location.

WP Design System – Multi Post Type Loop

Shows the posts of several post types in one Query Loop, for example posts, pages and a custom post type sorted together by date, optionally with a teaser of its own for each post type.

What it adds

  • Multi Post Type Loop, a variation of the Query Loop in the inserter category Theme. Post Template, pagination, No results, order and styles work as in the Query Loop; other Query Loops on the site are not touched.
  • Teaser for a Post Type, a block in the loop’s Post Template that holds the teaser of one post type. It is added and removed only through the loop’s settings, never through the inserter.

Setting it up

  1. Insert a Multi Post Type Loop, or turn a Query Loop into one under Transform to in its block toolbar. Transforming keeps the Post Template but starts the query over.
  2. Choose a pattern or a layout, as for a Query Loop. The plugin’s panels appear once the loop has content.
  3. In the panel Post types, tick the post types to show.
  4. In the panel Filters by post type, narrow them by taxonomy, parent, format or sticky posts. By default a filter narrows only the post types that have it: a category filter narrows the posts and leaves the pages complete. Switch to All post types to apply it to every post type, as a Query Loop does.
  5. To give a post type a teaser of its own, tick Dedicated teaser below it. The current teaser becomes the default for all other post types, and the new one starts as a copy of it.

Choosing a pattern or Change design keeps the variation but not its settings, so select the post types again afterwards. Without the plugin the block becomes a plain Query Loop with one of its post types, and every dedicated teaser shows one after another.

Patterns

FamilyThemePatterns
FilterCustomfilter-8-dynamic, together with WP Design System – Filter

For any other pattern, transform its Query Loop.

Works with

  • WP Design System – Map: a Query Map inside a Multi Post Type Loop shows the posts of all its post types that have a location.