27th Jun '25/0 commentsHow to Query WordPress Taxonomy Terms by Hierarchy Level in BricksSridhar Katakam This Pro tutorial provides the steps to limit the terms of a Bricks Terms query to only those at a specific level within the taxonomy hierarchy. Consider this WooCommerce product categories hierarchy: After implementing the tutorial we can output all terms in level 1 or 2 or 3 etc. Terms in level 1 (note this is also possible w/o any custom code): Terms in level 2: Terms in level 3: 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: BricksProTerms 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 Custom Nested Queries in BricksIn most of the previous tutorials covering nested query loops in Bricks on this site, we accessed the parent query's looping object in the inner…Read more →Categories: Bricks, ProTags: Nested Queries, Query Loop
Pro WooCommerce Product Reviews Bricks Query LoopCreating a custom query loop for WooCommerce product reviews for building custom review layouts.Read more →Categories: Bricks, Plugins, ProTags: Custom Query Type, WooCommerce
Pro Post sub field Bricks Query Loop in a Meta Box Group fieldLet's consider this Meta Box field group for Pages: FAQs is a Group-type of field in which one of the sub fields is "Answer Post",…Read more →Categories: Bricks, Plugins, ProTags: get_query_for_element_id, Meta Box, Nested Queries
Pro Non-empty events sorted by event date and other posts below in BricksUpdated on 15 Jan 2024 Consider a scenario where you are showing posts from multiple post types namely post, event and game in a single…Read more →Categories: Bricks, ProTags: meta_query
Pro Posts Grouped by Years and Months in BricksHow display posts organized by months & within years based on the published date.Read more →Categories: Bricks, ProTags: Nested Queries
Pro 6 Random Posts from Tag A + 6 Random Posts from Tag B in a Single Bricks Query LoopDisplaying two set of random posts, inside one query loop.Read more →Categories: Bricks, ProTags: Query Loop
Pro Excluding Duplicate Posts from Query Loops in BricksHow to ensure that posts are not duplicated when two query loops are used on the same page.Read more →Categories: Bricks, ProTags: Query Loop
Pro Categories and SubCategories Query Loop Tabs in BricksLearn how to show top-level parent categories as tab titles and the corresponding subcategories as tab contents using Bricks nested queries.Read more →Categories: Bricks, ProTags: Nested Queries, Query Loop
Pro Accordion Grid Query Loop in BricksHow to set up a accordion in Bricks such that the "titles" are arranged in a grid with the full width content opening below.Read more →Categories: Bricks, ProTags: Accordion, CSS, Query Loop