Hide or show elements conditionally based on post count in Bricks Builder

Back home

Show or hide elements conditionally depending on how many query loop items are returned.

show or hide elements based on post count in bricks builder

If you have a query loop in Bricks builder that displays events or any post type, but you currently have no posts available to show on it, you can use the query_results_count dynamic data tag to show or hide relevant elements on your page layout.

results count dynamic data bricks builder

The settings above will hide the selected element if the query loop returns zero results. Alternatively, you can use the => parameter to show elements if query result are greater than a specified number. Ensure you set the query loop id after the tag – like this (don’t forget to wrap the tag in curly brackets):


Have a project you'd like to discuss?

Book a discovery zoom call with Gerson.

Book Zoom Call