Updated on 2 Aug 2024
Consider this scenario:
CPT: Offer
Custom taxonomy: Offer Type
Sample offer types:
Output of Bricks terms query loop for the Offer Type taxonomy:
Remember that terms are ordered by name in ascending order by default.
This Pro tutorial shows how to exclude terms with duplicate names from a Bricks terms query while keeping the first occurrence of a term name and excluding any subsequent terms with the same name.
This can be useful when you want to ensure unique term names are displayed, perhaps to avoid confusion or to clean up the presentation of terms in a particular terms query loop.
After implementing the tutorial:
Step 1
Set up your terms query loop.
Step 2
Add the following in child theme's functions.php
(w/o the opening PHP tag) or a code snippets plugin:
This is a BricksLabs Pro tutorial.
For full access login below or create your BricksLabs Pro account