Back to Shortcodes

Updated on Nov 13, 2023

Combining Multiple Keys and Values in WP Slimstat Shortcodes

In WP Slimstat, you have the flexibility to combine multiple keys and values to create detailed filters. This is done using the &&& operator, allowing you to tailor your data tracking and analysis more precisely.

How to Use Multiple Filters

To concatenate or link multiple filters in a WP Slimstat shortcode, use the &&& operator. This enables you to refine the data displayed or tracked by the shortcode based on multiple conditions.

Example: Listing Popular Posts

Suppose you want to display the five most popular posts on your blog. You can achieve this by combining filters for content type and limiting results. Here’s the shortcode you would use:

[slimstat f='top' w='resource']content_type equals post &&& limit_results equals 5[/slimstat]

In this example:

  • content_type equals post: This filter ensures that only posts (not pages or other content types) are considered.
  • limit_results equals 5: This limits the output to the top five results.

By using these filters together, the shortcode precisely targets the most popular posts on your blog, showing only the top five.