# Group Bricks posts by category (loop)

> Here are the queries required to list your Bricks post loop items, grouped by category!

Author: Farhan Munim  
Published: 4 June 2025  
Updated: 22 October 2026  
Tags: Query loops  
Source: https://farhan.app/blog/group-bricks-posts-by-category-loop/

## Desired result

![Desired result: posts grouped under category headings such as Web development, Troubleshooting and Lifestyle, each with a View all button](https://cms.farhan.app/api/media/file/category-grouped-post-sections-result.png)

## Structure

![Bricks structure panel: Section, Container, Header with Category and Button, then a Post List containing a List Item with Heading, Date and Tags](https://cms.farhan.app/api/media/file/bricks-category-sections-structure.png)

## Query 1: Outer

![Bricks query loop set to Terms, taxonomy Categories (Post), ordered by meta value descending, number 20](https://cms.farhan.app/api/media/file/bricks-terms-query-loop.png)

## Query 2: Inner / Nested

![Bricks query loop set to Posts, post type Posts, four posts per page](https://cms.farhan.app/api/media/file/bricks-posts-query-loop.png)

![Bricks taxonomy query: Categories (Post), field term\_id, terms {term\_id}, compare IN, include children true](https://cms.farhan.app/api/media/file/bricks-taxonomy-query-term-id.png)
