Nested query loop: Custom Taxonomies within Custom Post Types

I was able to implement the original scenario without custom PHP code so I’m leaving this for anyone looking for solution using the current version of Bricks (1.11.1.1).

Task

Querry (custom) taxonomy inside (custom) posts loop.

Result

This is a bare bones result you will get

Querries setup

CPT loop

The “CPT loop” element has a basic setup like this. Of course you should select your own CPT in place of my “Portfolio”. Of course you can loop standard Posts as well.

Terms loop

The “CTax loop” element has a Terms qurry. Of course you should select your own CTax in place of my “Użycia tekstu (Portfolio)”. Of course you can loop standard Post Tags as well. The most important setting is in the bottom left corner which is a toggle with “Current post terms”. This option is available since Bricks 1.8.4 and is described in the Docs in the last paragraph here: Query Loop – Bricks Academy

Customization

For a quick showcase I’ve used the {post_id} and {term_id} but in a real life scenario those would get replaced by {post_title}, {term_name} or any custom fields attached to them.