The Dynamic Post Filter

This is a feature of the premium plugin. Tag Groups Premium

The Dynamic Post Filter is a tool for your pages where visitors can select groups and tags and immediately see posts that match their selection. It can be inserted into a page with the shortcode [[tag_groups_dpf]] or as a Gutenberg block.

Note: This shortcode or block can only be used once on a page (including widgets).

Displaying Posts Filtered by Groups and Tags

Imagine you write posts about your travels and you tag these posts with the names of the countries. Now, you may want to assemble all those country tags under a tag group called “Countries”. Using the Dynamic Group Filter, your visitors can now open the group “Countries” and then select tags of your countries. The list of posts refreshes automatically and displays all posts that match one of the selected country tags.

Dynamic post filter with tags, WordPress
Example of the 2-layered Dynamic Post Filter: First select the group, then the tags.

Performance

Please note that it is unavoidable that complex queries take some time to process in the database. That is particularly the case if many tags are selected in multiple groups. It is therefore highly recommended to use the parameter caching_time (in minutes) to speed up queries that have appeared recently before.

Alternatives

If you don’t want your visitors to enter the tags into the tag field, but select them with a toggle (on-off) switch, you could take a look at the Dynamic Post Filter With Toggles.

If you don’t need the interactivity of the Dynamic Post Filter, you may want to check out the Post List.

You can also use one of the tag clouds. They are highly customizable so that you can, for example, display all tags in the same size or prepend to each the same character. Using the tag clouds, however, visitors don’t see immediately the list of matching posts. Instead, a click on the tag takes them to a “tag page”, where all posts are listed that have this tag.

Parameters

For all available options, see the list of parameters.

Common Issues and Solutions

If no tags or no posts appear, please make sure that

  • you have selected the correct taxonomy. If you use something else than the default post_tag, use the taxonomy parameter.
  • you have assigned your tags to groups and used these tags in public posts (use the Meta Box).

If that still doesn’t help, you may want to try the buttons on the Troubleshooting page.

Demos

Demos are available on this page.

How do you rate this article?