10th Jul '25
/
0 comments

Category and Search Filtering for Nested Bricks Query Loops

This Pro tutorial provides the steps for adding a category names select dropdown and instant search input field for post titles (and excerpts, if present) so visitors can filter posts grouped by categories (or CPT posts grouped by a custom taxonomy) when using a Posts query loop nested inside a Terms query loop.

The solution incorporates:

  • Real-time category filtering with a dropdown interface
  • Instant search functionality that filters as users type
  • Combined filtering allowing users to search within specific categories
  • URL-based deep linking for clean URLs of shareable filtered results (?category=slug&search=term).
  • Custom post type compatibility that works with products, portfolios, events, or any post type
  • Custom taxonomy support for filtering by any taxonomy (categories, tags, or custom taxonomies)
  • A Reset button for the filters
  • No Results message for when there are no matching results
  • Browser back/forward button support

Step 1

Edit your Template or Page with Bricks.

Copy and paste the JSON of the fully-built Section from the link below.

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 625 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Frontend Filtering of Posts by a Date Picker Custom Field in Bricks

Frontend Filtering of Posts by a Date Picker Custom Field in Bricks

How to enable your site visitors to filter the posts (of any post type) by the value of a date picker type custom field.
Pro
Dynamic Horizontal Posts Accordion in Bricks

Dynamic Horizontal Posts Accordion in Bricks

Creating a horizontal accordion of featured images from posts output by Bricks' query loop.
Categories:
Tags:
Filtering Bricks Posts Query Loop by Meta Box Group’s Radio Subfield Value

Filtering Bricks Posts Query Loop by Meta Box Group’s Radio Subfield Value

In the past we showed how a Bricks posts query loop can be filtered by Meta Box group's subfield of types text/number and Datepicker here.…
Categories:
Pro
Parent post Bricks query loop

Parent post Bricks query loop

Updated on 5 Feb 2024 In the BricksLabs Facebook group a user asks: Is there a way to output the data of a parent post…
Categories:
Pro
Events grouped by months within years based on event date custom field value

Events grouped by months within years based on event date custom field value

How to output events grouped by years and months using three nested query loops in Bricks.
Categories:
Load more for Query loops in Bricks

Load more for Query loops in Bricks

Did you know that Bricks has AJAX loading for query loop posts on-click out of the box?
Categories: