28th Jan '24
/
2 comments

Sibling Terms Bricks Query Loop

Updated on 7 Feb 2024

In the Bricks Facebook group a user asks:

This Pro tutorial shows how bricks/terms/query_vars filter can be used to limit the terms of a Bricks Terms-type query loop to only the children of the current term's parent i.e., sibling terms on term archive pages.

We shall also cover the case where you may want to exclude the current term.

Step 1

Create a Bricks template of type Archive.

Edit it with Bricks and set a template condition such that it applies to all terms of your desired taxonomy.

Add a Section and inside its Container, a Heading whose text is set to:

{archive_title}

Add another Section and inside its Container, set up a query loop like this:

Note: If empty terms are to be output, make sure the corresponding query options control is enabled AND you add 'hide_empty' => false in the code below.

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

Get access to all 610 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Term-specific single post template in Bricks

Term-specific single post template in Bricks

Updated on 25 Jun 2025 In Reddit a user asks: Template conditional logic to exclude pages with a particular taxonomy term? I can't figure out…
Modifying ACF Field Value Before It Is Output

Modifying ACF Field Value Before It Is Output

Consider the scenario where a Page has a "Page Fields" field group created with ACF Pro like this: Field name: scientific_coordinators (type Repeater)|__ Sub field…
Categories:
Pro
Making a Nav Menu Item Active for Custom Post Type Single Views in WordPress

Making a Nav Menu Item Active for Custom Post Type Single Views in WordPress

Consider this scenario: CPT: project Page titled "Project" is being used to show a list/grid of all the projects rather than the CPT archive. When…
Categories:
Filtering out Media Items from “Select post/page” Bricks control

Filtering out Media Items from “Select post/page” Bricks control

The dropdown that appears after choosing "Internal post/page" when setting a link in Bricks shows media (attachment) items besides Pages, Posts and other CPTs. If…
Pro
Filtering a Bricks Terms query on Term archive pages

Filtering a Bricks Terms query on Term archive pages

On product category archives, how to show product type names but only those that the current product category has.