31st Jan '24/0 commentsAdding active class to the current term/post in a Bricks query loop on Term archives/single postsSridhar Katakam Updated on 29 Feb 2024 In the Sibling Terms Bricks Query Loop tutorial, a member asked: How can I set the class "active" to the current category ? This Pro tutorial shows how. This also applies to a posts query loop when viewing a single post, not just terms. Step 1 Add the following in child theme's functions.php (w/o the opening PHP tag) or a code snippets plugin: This is a BricksLabs Pro tutorial. For full access login below or create your BricksLabs Pro account Username Password Remember Me Forgot Password Tagged: BricksProQuery LoopTerms QuerySridhar KatakamSridhar Katakam is a Bricks enthusiast. He likes helping others by researching and solving WordPress-related problems and building websites.Get access to all 633 Bricks code tutorials with BricksLabs Pro
Pro Category Posts Accordion in BricksThis Pro tutorial provides the steps to set up a dynamic accordion of posts grouped by their categories based on the previous Posts Grouped by…Read more →Categories: Bricks, ProTags: Accordion, bricks/posts/query_vars, Nested Queries
How to apply a custom query var to multiple query loops in BricksIn this tutorial, we'll learn how to apply a PHP filter to modify the query var of multiple query loops in a single function Introduction…Read more →Categories: Bricks, FreeTags: Dynamic Data, Query Loop
Load more for Query loops in BricksDid you know that Bricks has AJAX loading for query loop posts on-click out of the box?Read more →Categories: Bricks, FreeTags: Load more, Query Loop
Pro ACF User Field Bricks PHP QueryIn the Bricks Facebook group a user asks: my end goal was to create a set of cards that would display the Users that are…Read more →Categories: Bricks, Plugins, ProTags: ACF, Users Query
Pro Bricks Query Loop for Top-level Parent Pages with ChildrenIn the Bricks Facebook group, a user asked: Looking for a custom query to output a list of posts in the same hierarchy that the…Read more →Categories: Bricks, ProTags: Nested Queries, Query Loop
Pro Posts from Random Categories in BricksUpdated on 31 Jul 2023 In BricksLabs Facebook group a user asked: How would you query 3 WordPress posts from 3 different categories with Brick…Read more →Categories: Bricks, ProTags: bricks/posts/query_vars
Pro Adjacent Posts Bricks Query LoopThis Pro tutorial provides the steps to customize a posts query loop in Bricks to show previous and next posts on single post pages. The…Read more →Categories: Bricks, ProTags: Adjacent posts
How to Show Future Events in BricksOne of the common requirements in WordPress is being able to filter the events (or could be posts of any post type) to only those…Read more →Categories: Bricks, FreeTags: Meta Query
Pro Weekday Column Posts Bricks Query LoopThe steps to arrange the posts output by a Bricks query loop(s) in weekday columns based on a weekday custom field.Read more →Categories: Bricks, ProTags: CSS Grid, Data Attributes, Nested Queries, Query Loop