Dynamic Post Filter – Shortcode Parameters

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

Note: This shortcode is also available as Gutenberg block. You can configure the block without using any code or parameters. Read more about the block options.

Note: This shortcode or block can only be used once on a page (including widgets), and it cannot be used together with the shortcode or block of the Dynamic Post Filter With Toggles.

If you don’t know what is a shortcode and how to use it, you first may want to read this article.



From the upcoming version 1.19.0, posts can be displayed separated from the menu. Simply use in this shortcode separate=1 and add a second shortcode:



[tag_groups_dpf include=1,2,3,5 open=1,2,3,5 caching_time=60 persistent_filter=60 pager=1 display_amount=1 transition=fade]

Data Types

  • string: A text. For identifiers that won’t be visible to visitors you often have to replace spaces with _ or -. If the string contains spaces, you need to wrap it in quotes.
  • integer: A number without decimal places.
  • 0 or 1: 0 turns the feature off and 1 on.

Gutenberg Block

If you are using Gutenberg, most of the parameters below will also be available in the corresponding block. You can always convert a block to a shortcode while preserving your settings.


Tags and Terms


Restrict the tags only to these taxonomies. Available are only taxonomies that have been activated in the Settings.

accepted valuesdefaultexample shortcode
comma-separated list of taxonomy namesTaxonomies selected in the settings under “Basics”.taxonomy=post_tag,product_tag


How the tags should be logically connected. Possible values are “IN” (At least one tag matches.), “AND” (All tags match.) and “IN AND” (At least one tag from each group matches).

accepted valuesdefaultexample shortcode
stringINoperator="IN AND"



Tag groups that will be selectable by visitors. In the short code you use the IDs, which you find in the left column in the list of groups. Empty or not used means that all tag groups will be used.

accepted valuesdefaultexample shortcode
comma-separated list of integersempty (=all)include=1,5,9


Tag groups that are initially open. If you use include, then all selected groups must also be included. Empty or not used means that all tag groups will be open.

accepted valuesdefaultexample shortcode
comma-separated list of integersempty (=all)open=1,9


Disables the possibility to remove the input fields of groups. You can use that option together with the include and open parameters if you want to show a fixed set of groups that cannot be altered by visitors.

accepted valuesdefaultexample shortcode


Changes the default select menu to a more stylish one.

accepted valuesdefaultexample shortcode


Skip the tag selection and display all products that match the selected groups.

accepted valuesdefaultexample shortcode



Time in minutes that results remain in the cache.

accepted valuesdefaultexample shortcode


How many posts appear under the filter. Use -1 to show all.

Please note that high numbers of posts may impact the performance.

Tip: If you use the parameter “display_amount” you can reduce the additional database request by using posts_per_page=-1 instead of a high number of posts.

accepted valuesdefaultexample shortcode


If the pager is enabled then visitors can load the next or previous page.

accepted valuesdefaultexample shortcode


Which field to use for sorting.

randrandom order; recommended to use also caching_time=0
accepted valuesdefaultexample shortcode


Whether to sort the posts in ascending or descending order. Ascending order also means from oldest to newest.

accepted valuesdefaultexample shortcode


Whether to display a line that shows the total amount of posts.

accepted valuesdefaultexample shortcode
0 or 10display_amount=1


HTML code that contains some placeholders. If you use only one template on your entire website, it is recommended to leave this parameter empty and edit the default template in the Front End settings.

After version 1.31.6: In order to prevent that WordPress adds malformed <p></p>, the < and > need to be encoded as &lt; and &gt;. Simply convert your HTML using an online tool.

Possible placeholders are: {post_id}, {post_title}, {permalink}, {post_excerpt} (automatically generated), {post_excerpt_html} (preserves most common html tags), {post_date}, {post_author}, {image_src} or {image_src|image size}, {image_alt}, {post_category}, {post_tags}, {custom_field:<name>}1. Make sure that single or double quotes appear only once as initial and final delimiters, while the other type of quotes can be used inside the template code.

image_src also accepts percentages or “auto” as values. If you want to use pixels, you enter the number without any “px”

accepted valuesdefaultexample shortcode
stringsee below
template='&lt;a href="{post_guid}"&gt;{post_title}&lt;/a&gt;'

Default template:

<header class="tg-entry-header">
<a href="{permalink}" rel="bookmark"><img src="{image_src|100x100}" alt="{image_alt}" class="tg-entry-image" /></a>
<h3 class="tg-entry-title"><a href="{permalink}" rel="bookmark">{post_title}</a></h3>
Posted on {post_date} by {post_author}.
<div class="tg-entry-content"><p>{post_excerpt}</p></div>
Image sizes

The following formats are possible:

  • keywords like “thumbnail”, “medium”, “large” or any custom image size2. This method provides the best performance when loading an image. You can change the sizes in the general Media settings of your WordPress site and then use a plugin such as Regenerate Thumbnails to generate the new sizes.
  • width and height, separated by “x”. On both sides you can use numbers (sizes in pixel), percentages or the keyword “auto”. The image loaded by the browser may actually be larger and scaled down.

Examples for the image tag:

<img src=”{image_src|medium}” alt=”{image_alt}” class=”tg-entry-image” />
<img src=”{image_src|100×150}” alt=”{image_alt}” class=”tg-entry-image” />
<img src=”{image_src|100%×auto}” alt=”{image_alt}” class=”tg-entry-image” />


Transition between loading the list of posts.

accepted valuesdefaultexample shortcode


Optionally filter also by terms of an additional taxonomy (not necessarily one of the taxonomies used for tag groups). Used together with static_terms.

accepted valuesdefaultexample shortcode


Optionally filter also by terms of an additional taxonomy (not necessarily one of the taxonomies used for tag groups). Used together with static_taxonomy.

accepted valuesdefaultexample shortcode
comma-separated list of integersnonestatic_terms=42,255



The Dynamic Post Filter can optionally remember the selection of groups and tags so that your visitors who clicked on an article and then return to this page will see the same list of articles again. After loading, the page will scroll to the group selection menu. (Otherwise the browser might go to a random post, depending on the loading speed.)

The data is saved in a browser cookie. If you use several Dynamic Post Filters on your site, you should give each a different div_id so that each will have its own cookie.

The value is the time in minutes. Zero means off.

accepted valuesdefaultexample shortcode
integer0 (off) persistent_filter=30

Labels and Messages


Placeholder message in the tag input field. It disappears as soon as you enter tags.

accepted valuesdefaultexample shortcode
string“Please enter your tags here.”placeholder=""


Placeholder message for the list of posts.

accepted valuesdefaultexample shortcode
string“Please select a group.”posts_placeholder=""


What the pull-down menu should show if no group is selected.

accepted valuesdefaultexample shortcode
string“Filter by group”default_option_label=""


Header above the list of selected groups.

accepted valuesdefaultexample shortcode
string“Selected groups:”groups_header=""


Error message if user tries to enter a tag that doesn’t exist.

accepted valuesdefaultexample shortcode


Error message if user tries to enter a tag from another group.

accepted valuesdefaultexample shortcode


Message to show if no posts were found.

accepted valuesdefaultexample shortcode
string“Nothing found.”message_nothing_found=""


Label of the link to load more posts, if the pager is active.

accepted valuesdefaultexample shortcode
string“Load more”message_load_more=""


Label of the link to go back, if the pager is active.

accepted valuesdefaultexample shortcode
string“Go back”message_go_back=""


Message if one post was found, if display_amount is active.

accepted valuesdefaultexample shortcode
string“1 post found.”message_amount_singular="One recipe found."


Message if many posts were found, if display_amount is active. May contain the placeholder {count}

accepted valuesdefaultexample shortcode
string“{count} posts found.”message_amount_plural="We found {count} recipes."

Advanced Styling

You can set here classes to be referred to in CSS. You need some knowledge of CSS to use these options.


Define a class for the <div>.

accepted valuesdefaultexample shortcode


Define an ID for the enclosing <div>.

accepted valuesdefaultexample shortcode


  1. A alue from the post meta <name>. See also tag_groups_template_custom_field[]
  2. Custom sizes may be registered by your theme or another plugin.[]