Excluding Duplicate Posts from Query Loops in Bricks

This Pro tutorial provides the steps to ensure that posts are not duplicated when two query loops are used on the same page in Bricks.

Let's take a sample scenario where we have 2 query loops.

  • The first query loop shows 6 random testimonials.
  • The second query loop is also set to show 6 (or can be any number of) random testimonials.

Since the posts are random, it is possible to have the same post(s) appear in both the loops at any given time.

After implementing this tutorial, any posts that may be output in the first query will not be included in the posts output by the second query.

Step 1

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Instant access to 390+ Bricks code tutorials with BricksLabs Pro