Bricks Builder Query Loop Pagination: Setup and Troubleshooting
A Bricks Builder query loop can turn one designed card into a live list of posts, products, or other WordPress content. Add pagination and readers can browse beyond the first results. Add filters and they can narrow the listing instead of scanning every item.
The part that commonly causes trouble is connecting each control to the right loop. A pagination element pointed at the wrong query can show unexpected pages or a 404. A filter can appear on the page but do nothing if its target loop, query type, or index is wrong.
This guide walks through a practical setup, explains how Bricks connects pagination and filters to loops, and gives you a repeatable way to troubleshoot them. Bricks’ current documentation covers the Query Loop and Query Filters elements; exact labels may vary between versions. Bricks Query Loop documentation and Bricks Query Filters documentation
What a query loop does
A query loop repeats a layout for each result returned by a query. You build one card, row, or content block, then Bricks uses that design to display the results.
A blog card might contain:
- Featured image
- Post title
- Category
- Excerpt
- Read more link
With the query loop enabled, the card repeats for each post. Dynamic data fields resolve against the current result, so the title and image change from card to card. Bricks documents Query Loop support for layout elements such as Container, Section, Block, and Div. Bricks Query Loop documentation
The loop does not decide how visitors navigate the results by itself. Pagination, filters, and load more controls are separate elements or behaviors that need to target the intended loop.
Build a simple post loop first
Start with one loop and no filters. This isolates query problems before you add AJAX, pagination, or custom behavior.
- Open the page or template in Bricks.
- Add a layout element that will contain the repeated card.
- Enable the Query Loop setting on that element.
- Choose the post type and set a reasonable number of results per page.
- Add the card layout inside the loop element.
- Connect the image to Featured Image.
- Connect a heading to Post Title and link it to Post URL.
- Add an excerpt or read more link if it helps readers.
- Preview the page and confirm each card displays a different post.
Bricks’ getting-started guide demonstrates the same general pattern: enable a loop, set the query, and bind card elements to dynamic data such as Featured Image and Post Title. Bricks query loop tutorial
Give the loop a clear name, such as “Blog archive query” or “Product cards.” Descriptive names make it easier to select the correct target later, particularly when a page has multiple loops.
Add pagination and connect it to the loop
Pagination lets visitors move through results in smaller groups. In Bricks, the Pagination element can sit separately from the loop, giving you flexibility over its position and style.
Use this checklist:
- Confirm the query returns more results than fit on the first page.
- Add the Pagination element after the loop.
- Open its settings.
- Select the intended loop in the Related Query control.
- Choose a pagination style.
- Preview the page and test the next and previous controls.
- Check that the URL or result state changes as expected.
The Bricks documentation says the Pagination element should be connected to the element running the query through its Related Query control. Bricks Query Loop documentation
If pagination does not appear, inspect the query’s posts-per-page setting and check whether enough published content exists for another page. A loop that returns five posts with a limit of ten has no second page to show.
Use a predictable sort order. If multiple posts share the same sorting value, a secondary sort can help keep pagination stable when content is added or edited. Bricks’ documentation specifically recommends a stable secondary sort when paginating. Bricks Query Loop performance guidance
Add filters that help visitors
Bricks Query Filters can narrow a loop by search term, taxonomy, field, sort order, or another supported value. Each filter needs to target a specific query loop. The filter does not have to sit inside the same wrapper as the results. It can appear above the listing or in a sidebar, as long as it points to the right query. Bricks Query Filters documentation
A basic setup looks like this:
- Confirm Query Filters are enabled in Bricks settings.
- Create the query loop for the listing.
- Add only the filter controls readers need.
- Set each filter’s Target Query to the intended loop.
- Add a Pagination element if the result set spans pages.
- Enable AJAX on pagination if it should work with the filters.
- Save the page so Bricks can build the filter index.
- Test a filter, reset it, and test again.
For example, a tutorial library might have a search field and a category dropdown. It may not need date range, author, and several custom-field filters if visitors rarely use them. Start with the smallest set that solves a clear navigation problem.
What query IDs do
Bricks uses the loop element’s identity to connect filters, pagination, AJAX updates, and load more behavior. The documentation describes a loop ID that is commonly the six-character Bricks element ID without the #brxe- prefix. Bricks Query Loop documentation
In the builder, choose the loop through the available target or related query control when possible. IDs become useful when troubleshooting URL parameters or custom behavior.
A page with more than one loop deserves extra care. Imagine the page has a featured-post section and an archive grid. Pagination for the archive must not target the featured-post loop. Give each loop a descriptive label, then verify the target after duplicating, moving, or rebuilding elements.
Choose a navigation pattern
Standard pagination
Standard pagination loads another page of results after someone selects a number or next link. It is a useful default for blog archives and directories because visitors can navigate back and forth.
AJAX pagination
AJAX pagination updates results without a full page reload. It may feel quicker, but test what happens to the browser back button, direct links, keyboard focus, and loading feedback. Visitors should be able to tell that the result list changed.
Load more or infinite scroll
A “Load more” button lets visitors request additional results while remaining on the same page. Infinite scroll may load more automatically. Bricks documents support for pagination, load more, and infinite scroll with query loops. Bricks Query Loop documentation
Choose the behavior that fits the visitor’s task. A blog reader may want predictable archive pages. A directory visitor may prefer a button to display more results. Avoid making infinite scroll the only way to access older content unless you have tested accessibility and usability.
Troubleshoot the common failures
Pagination returns a 404
Check which loop is marked as the main archive or search query. Bricks’ troubleshooting guidance says the archive loop and Pagination element must be configured to target the correct query. Bricks Query Loop troubleshooting
Then check whether there are enough results for another page and whether your archive URL works without the builder preview. If you changed permalink settings recently, save them and test the archive again.
A filter does nothing
First confirm the filter targets the correct loop. Next, confirm that the selected query type is supported by that filter. Bricks documents support for post, term, and user loops, with limits for API and array query loops. Bricks Query Loop documentation
Then check the content. If the filter looks for a category term that no posts have, an empty result is expected. Review the filter’s stored value and the actual terms or custom field values assigned to the posts.
AJAX pagination or filters stop after an update
Bricks notes that after updating to version 2.5, old cached HTML may lack query context required by updated requests. It also cautions that optimization plugins should not strip Bricks loop HTML comments used as markers. Bricks Query Loop troubleshooting
Try clearing the page cache and server cache, then test again. If the issue remains, check whether an optimization setting is minifying or removing the loop markup. Change one setting at a time so you can identify the cause.
The loop shows unexpected posts
Review the query’s post type, taxonomy conditions, sort order, and whether it should merge with the current archive query. Bricks advises configuring the main archive/search loop differently from unrelated loops on the same page. Bricks Query Loop documentation
If the page has been duplicated, inspect the query settings instead of assuming the copied loop matches the new page’s purpose.
The builder preview differs from the public page
Save the page and check the public URL in a private browser window. Clear the relevant cache and confirm the correct template applies to the URL you are testing. The builder canvas may not reproduce every front-end condition exactly.
Keep the query manageable
A query loop should return only the results the page needs. Bricks recommends setting a realistic number of results, keeping nested loops small, and avoiding unlimited results on large datasets. Its documentation also describes “No Found Rows” for cases where pagination and result counts are not needed. Bricks Query Loop documentation
Practical ways to control query work:
- Set a sensible posts-per-page limit.
- Avoid
-1on a large or growing content library. - Keep nested loops small.
- Disable query merging on unrelated loops when appropriate.
- Use “No Found Rows” only when you do not need pagination or totals.
- Add filters only when they solve a real visitor need.
- Recheck the layout after adding custom-field or taxonomy filters.
Test the page before launch
Use this repeatable test:
- Load the first page and confirm the correct results appear.
- Open the next page and confirm the content changes.
- Apply each filter and inspect the results.
- Reset filters and confirm the complete listing returns.
- Test a direct URL with filter parameters if you use them.
- Try the browser back button on AJAX listings.
- Test the empty-results state.
- Check the layout and controls on a phone.
- Use keyboard navigation to reach and operate the controls.
- Clear cache and repeat the test on the public page.
Bricks supports loading filters from URL parameters, which can make a filtered view linkable. Test that URL directly instead of assuming the filter state will restore correctly. Bricks Query Filters documentation
Conclusion
Bricks query loops let one design display changing WordPress content. Pagination and filters can make a large listing easier to use, but every control needs to target the right loop.
Start simply, label loops clearly, connect controls with Related Query, and test the public page after saving. Add AJAX or extra filters only when they help visitors complete a task. Keep the query focused and test the empty state, mobile layout, and browser navigation before launch.
Credible sources
Frequently Asked Questions
How do I connect Bricks pagination to a query loop?
Add a Pagination element and select the correct loop in its Related Query setting. Give the loop a descriptive name so you can identify it easily.
Why does Bricks pagination show a 404?
Check that the archive loop is configured for the archive context, and that pagination targets that loop. Confirm that the query has enough results to create another page.
Can Bricks filters work with AJAX pagination?
Bricks documents AJAX pagination and filters as supported behaviors. Enable AJAX where appropriate, and verify both controls target the same query loop.
Should I use infinite scroll on a blog?
It depends on how readers use the archive. Standard pagination is predictable. “Load more” can be useful for some listings. Test keyboard use, mobile behavior, and whether readers can return to results they have already seen.
Why does a filter show no results?
The filter may target the wrong loop, use a value that is not assigned to any matching content, or target a query type it does not support. Check those points before rebuilding the page.
