Taxonomy Element: Filter Categories that are shown and Show only Primary Category

Wow! How to use this code inside Bricks uery loop?