Filter Grid for Divi 5

Documentation

Filter Grid for Divi 5 adds one module to the Divi 5 builder: a grid of posts, pages or custom post types that visitors filter, search and paginate without reloading the page. This guide covers installation, every setting and the hooks available to developers.

Requirements

SoftwareVersion
DiviDivi 5, as the theme or the Divi Builder plugin
WordPress6.5 or later (tested up to 7.1)
PHP7.4 or later (tested up to 8.3)

The module is built for the Divi 5 API only. It does not run with Divi 4.

Installation

  1. Download the plugin zip file from your Divi Marketplace account.
  2. In WordPress, go to Plugins → Add New Plugin → Upload Plugin, choose the zip file and click Install Now.
  3. Click Activate.

Updates are delivered through the Divi Marketplace, in your WordPress dashboard, like other Divi products. If Divi 5 is not active, the plugin shows a notice and the module stays hidden until it is.

Add the module to a page

  1. Open a page with the Divi 5 builder.
  2. Click the + button in a column and search for Filter Grid.
  3. In Content → Source, choose the post type to show.
  4. In Content → Filters, tick the taxonomies visitors can filter by.
  5. Choose a pagination style, adjust the design, then save the page.

The preview in the builder is rendered by the same code as the live page, so what you see is what visitors get. The module also works inside Divi Theme Builder templates.

Content settings

The Content tab sets what the grid shows and how visitors interact with it.

Source

SettingWhat it doesChoices
Post TypeChoose which content to show in the grid.Every public post type of your site
Items Per PageNumber of items shown per page (1 to 100).–
Order ByChoose how the items are sorted.Date, Title, Menu order, Custom field (text), Custom field (number)
OrderChoose the sort direction.Descending, Ascending
Custom Field KeyMeta key used when ordering by a custom field.–
Exclude IDsComma-separated list of post IDs to leave out.–
Exclude Current PostLeave out the post or page this grid is displayed on.–

Filters

SettingWhat it doesChoices
Show FiltersLet visitors filter the grid by taxonomy terms.–
TaxonomiesOne filter group is shown per selected taxonomy. Taxonomies that do not belong to the chosen post type are ignored.Every public taxonomy of those post types
Filter StyleShow the terms as buttons or in a dropdown. A dropdown always selects a single term.Buttons, Dropdown
Show "All" OptionAdd an option that clears the filter.–
"All" LabelLeave empty to use the default translated label.–
Multiple SelectionLet visitors select several terms at once (buttons only).–
Multiple Selection LogicOR shows items matching any selected term. AND shows items matching all of them.OR (any term), AND (all terms)
SettingWhat it doesChoices
Show Search FieldLet visitors search the grid by keyword.–
PlaceholderLeave empty to use the default translated placeholder.–

Elements

SettingWhat it doesChoices
Show Featured ImageShow the featured image of each item.–
Image SizeRegistered image size used for the featured image.Thumbnail, Medium, Medium large, Large, Full size
Show TitleShow the title of each item.–
Show DateShow the publication date.–
Show CategoriesShow the terms of the first filter taxonomy.–
Show ExcerptShow an excerpt of each item.–
Excerpt LengthMaximum number of words in the excerpt.–
Show Read More ButtonShow a link to each item.–
Read More TextLeave empty to use the default translated text.–

Pagination

SettingWhat it doesChoices
PaginationChoose how visitors reach the next items.Page numbers, "Load more" button, Infinite scroll, None
"Load More" TextLeave empty to use the default translated text.–
Text fields left empty use the default label, translated in the language of your site (English and French are included).

Design settings

The Design tab uses the native Divi 5 controls, with hover states and per-device values where Divi offers them.

GroupWhat you can style
GridNumber of columns and gap between cards, set per device (desktop, tablet, phone).
FiltersText, background, border and spacing of the filter buttons and dropdown.
Active FilterText, background and border of the selected filter.
Search FieldText, background, border and spacing of the search field.
CardBackground colour, border, spacing and box shadow of each card.
Card ContentInner spacing of the text part of the card, so the image can stay edge to edge.
ImageBorder (rounded corners) and box shadow of the featured image.
Read MoreText, background, border and spacing of the "Read more" link.
PaginationText, background, border and spacing of page numbers and of the "Load more" button, plus the current page.

The module also has the usual Divi groups for the whole module: sizing, spacing, border, box shadow, filters, transform and animation.

Advanced settings

The Advanced tab has the standard Divi options (CSS ID and classes, visibility, position, scroll effects) and custom CSS fields for each part of the grid: filters, filter, active filter, search field, grid, card, card content, image, title, meta, excerpt, read more and pagination.

Filtered URLs

When a visitor filters or searches, the address in the browser changes, so a filtered view can be bookmarked or shared, and the back button returns to the previous view.

ParameterMeaningExample
d5fg_<taxonomy>Selected terms of a taxonomy, by slug, comma-separated?d5fg_category=news,events
d5fg_sSearch words?d5fg_s=coffee
d5fg_pagePage number (page numbers style only)?d5fg_page=2

Taxonomy names are shortened in the URL: category becomes d5fg_cat and post_tag becomes d5fg_tag. Page links are real links, so they keep working without JavaScript.

Performance and caching

Accessibility

For developers

PHP hooks

HookTypeArgumentsUse
d5fg_post_typesfilterarray $typesPost types offered as a source (name => label).
d5fg_query_argsfilterarray $args, array $settings, array $stateWP_Query arguments of every grid query.
d5fg_filter_termsfilterWP_Term[] $terms, string $taxonomy, array $settingsTerms shown in a filter group.
d5fg_card_htmlfilterstring $html, WP_Post $post, array $settingsHTML of one card.
d5fg_cache_ttlfilterint $secondsHow long query results are cached. Default: one hour.
d5fg_cache_enabledfilterbool $enabledTurns the result cache off when false.

Example: hide an internal post type from the Source list.

add_filter( 'd5fg_post_types', function ( $types ) {
    unset( $types['my_internal_type'] );
    return $types;
} );

JavaScript event

Each grid dispatches d5fg:updated after new results are shown. event.detail holds the current state (terms, search, page) and the total number of results.

document.addEventListener( 'd5fg:updated', function ( event ) {
    console.log( event.detail.total + ' results' );
} );

REST endpoint

Results are loaded from /wp-json/d5fg/v1/query. The module settings travel in a token signed by your site, so visitors cannot change the post type or read content that the grid does not show. Drafts, private and password-protected posts are never returned.

FAQ

Does it work with Divi 4?

No. The module is written for the Divi 5 API, which is why it does not need the Divi 4 compatibility mode.

Can I use it with WooCommerce products or custom post types?

Yes. Every public post type appears in the Source list, including products and post types created with a plugin or in code. Filters on product attributes and price are planned.

Can I filter by custom fields (ACF)?

Not in version 1.0: filters use taxonomies. Ordering by a custom field is supported (Order By → Custom field). Filters on ACF fields are planned.

Can I put several grids on one page?

Yes. Each grid works on its own. If two grids filter the same taxonomy, they share its URL parameter.

The grid shows "No results found" but I have content.

Check that the selected taxonomies belong to the chosen post type, that the items are published, and that they are not listed in Exclude IDs.

Is it translated?

The front-end texts are translation ready, with English and French included. The builder settings are in English.

Changelog

1.0.0

First release.

Support

Open a ticket from the support tab of the product page on the Divi Marketplace. Your licence includes one year of support and updates for unlimited websites.