Bricks Builder Query Loops: Dynamic Content Made Easy
Bricks Builder is WordPress's newest visual page builder that focuses on clean code and performance. Unlike Elementor or other builders, Bricks generates minimal HTML and CSS, making your WordPress websites faster and more efficient.
Query loops are Bricks' most powerful feature. They automatically display dynamic content from your WordPress database - posts, products, custom post types, or anything else you can think of.
Think of query loops as smart content containers. Instead of manually adding each blog post or product to a page, you create one template that automatically fills with whatever content matches your criteria.
Why Query Loops Matter
Most website owners manually update their homepage when they publish new content. Query loops eliminate this busywork. Your latest blog posts, featured products, or team members appear automatically.
This isn't just about convenience. Dynamic content keeps your website fresh, which search engines love. It also ensures visitors always see your most recent content without you lifting a finger.
Setting Up Your First Query Loop
Let's create a simple blog post display. This tutorial assumes you have Bricks Builder installed and activated.
Step 1: Create a New Template
- Go to Bricks > Templates in your WordPress dashboard
- Click Add New Template
- Choose Section as the template type
- Name it "Blog Posts Loop"
- Click Create Template
Step 2: Add the Container Element
- Click the + icon to add an element
- Select Container from the structure elements
- In the container settings, set the layout to Flex
- Change the direction to Column
- Set a maximum width of 1200px
Step 3: Add the Query Loop Element
- Inside your container, click + again
- Find Query Loop under the WordPress elements
- Drag it into your container
The magic happens in the query settings panel that appears on the right.
Step 4: Configure Your Query
In the Query tab:
- Post Type: Select "Posts" (or whatever content type you want)
- Posts Per Page: Enter how many posts to show (try 6 to start)
- Order By: Choose "Date" to show newest first
- Order: Select "DESC" for newest to oldest
Your query loop now knows what content to fetch. But we need to tell it how to display each item.
Step 5: Design Your Post Template
Inside the query loop, you'll see a single post item. This is your template - whatever you build here repeats for each post in your query.
Add these elements inside the post item:
- Image element for the featured image
- Heading element for the post title
- Text element for the excerpt
- Button element for "Read More"
Step 6: Connect Dynamic Data
Now we link each element to dynamic post data:
For the Image:
- Select the image element
- In the settings, click the database icon next to "Image"
- Choose Featured Image
For the Heading:
- Select the heading element
- Click the database icon next to "Text"
- Choose Post Title
- Set the HTML tag to H3 or H4
For the Text:
- Select the text element
- Click the database icon
- Choose Post Excerpt
- Set a word limit (try 25 words)
For the Button:
- Select the button element
- Set the text to "Read More"
- Click the database icon next to "Link"
- Choose Post URL
Pro Tips for Better Query Loops
Use Custom Queries for Specific Content
Want to show only posts from certain categories? In the query settings:
- Go to Meta Query
- Add a new condition
- Set Key to "category"
- Choose your category from the dropdown
Add Pagination for Long Lists
For posts pages, add pagination:
- Add a Pagination element below your query loop
- It automatically connects to your query
- Style it to match your design
Create Grid Layouts
Make your posts display in a grid:
- Select your query loop element
- In the Style tab, set Display to "Grid"
- Use Grid Template Columns to set column count
- Try "repeat(3, 1fr)" for three equal columns
- Add Gap for spacing between items
Filter by Custom Fields
Advanced users can filter by custom fields:
- In query settings, go to Meta Query
- Set Key to your custom field name
- Choose comparison type (equals, not equals, etc.)
- Enter the value to filter by
Common Query Loop Use Cases
Recent Blog Posts on Homepage
Perfect for keeping your homepage fresh. Set posts per page to 3-4 for a clean look.
Portfolio Grid
Query your portfolio custom post type. Use a grid layout with hover effects for a professional showcase.
Team Members
Create a custom post type for team members. Display them with photos, names, and roles.
Product Showcase
Query WooCommerce products with specific categories or tags. Great for restaurant website design featuring menu highlights.
Testimonials Slider
Query testimonials and combine with Bricks' slider element for rotating customer reviews.
Troubleshooting Common Issues
Query Returns No Results
- Check your post type is correct
- Verify posts exist with your filter criteria
- Make sure posts are published, not drafts
Styling Looks Wrong
- Remember you're styling the template, not individual posts
- Use CSS Grid or Flexbox for consistent layouts
- Test with different screen sizes
Performance Issues
- Limit posts per page to reasonable numbers
- Use pagination instead of loading everything
- Consider website maintenance to optimise your site
Beyond Basic Queries
Once you're comfortable with simple queries, explore advanced features:
- Related Posts: Query posts with similar tags or categories
- User-Based Content: Show different content based on logged-in users
- Search Results: Create custom search result pages
- Archive Pages: Design category and tag archive templates
Query loops transform static websites into dynamic content machines. They're particularly powerful for businesses that regularly publish content, like accountant websites with regular tax updates or solicitor websites with legal news.
The key is starting simple. Master basic post queries before moving to complex custom field filtering. Once you understand the concept, you'll find dozens of ways to automate your content display.
Your visitors get fresh, relevant content automatically. You get more time to focus on your business instead of manually updating pages. That's the real power of Bricks Builder query loops.