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
Random Posts in the Same Category as the Current Single CPT Post in BricksHere’s how query loop can be set in Bricks to show related posts by a taxonomy’s termsRead more →Categories: Bricks, FreeTags: Query Loop
Pro Post ID Query Variable-based Post Output in BricksHow to query a single post of a custom post type using the post ID passed to a page via a URL parameter.Read more →Categories: Bricks, ProTags: Query Variables, URL Parameter
Pro Masonry Accordion Query Loops in Bricks BuilderLearn how to enable masonry layout for nestable accordions in Bricks builder and use JavaScript to re-layout the masonry on accordions' open and close.Read more →Categories: Bricks, JavaScript, ProTags: Accordion
Pro Checking if the current term in a Bricks Terms query loop of the given taxonomy has childrenThere could be situations when you need a way to check if the current term in a Bricks Terms query loop has children or not.…Read more →Categories: Bricks, ProTags: Terms Query
How to create filters with IsotopeJS in Bricks (Part 4): AJAX filter and infinite loops, Sorting, List view and Disable animationsThis tutorial will explain how to enable the AJAX filter with an infinite scroll query loop container, how to add a sorting function, how to…Read more →Categories: Bricks, FreeTags: Filters, Isotope, Query Loop
Pro Displaying Gallery of SureCart Product Images with Bricks’ Query LoopCustom query loop for looping through SureCart product images.Read more →Categories: Bricks, Plugins, ProTags: SureCart
Pro CMB2 Repeatable Group Bricks Query LoopThis Pro tutorial provides the steps to create a custom query loop type for outputting the subfield values of a Group field (repeatable) when using…Read more →Categories: Bricks, Plugins, ProTags: CMB2, Custom Query Type
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
Pro ACF Post Object Query Loop inside a Posts Query Loop in BricksHow to loop through a CPT and within each post, output a list of related posts.Read more →Categories: Bricks, Plugins, ProTags: ACF, Nested Queries