23rd Jun '23/0 comments/FavoriteQuery Loop Index in BricksSridhar Katakam This Pro tutorial provides the code for getting the index of each post in Bricks' query loops. This can be used for either outputting the post number (screenshot below) or for checking for nth post and conditionally outputting elements (Ex.: How to Insert Element(s) Between Query Loop Posts in Bricks). Note: If you have BricksExtras installed, there is no need to use the below custom function. BricksExtras comes with it. Check the Dynamic Tags doc page. Step 1 Add the following in child theme's functions.php 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: BricksLoop IndexProSridhar KatakamSridhar Katakam is a Bricks enthusiast. He likes helping others by researching and solving WordPress-related problems and building websites.Get access to all 525 Bricks code tutorials with BricksLabs Pro
Loop Item ID and Loop Item Object in BricksIf you are working on a Bricks site with specific requirements, chances are you need to grab the ID and/or object of the current item…Read more →Categories: Bricks, FreeTags: \Bricks\Query
Pro ACF Select Field Query Types in BricksIn the BricksLabs Facebook group a user asks: Hi all, I am building a single post template for a CPT and want to know if…Read more →Categories: Bricks, Plugins, ProTags: ACF, Custom Query Type, Query Loop
How to populate a map with dynamic markers from a CPT using ACF in Bricks (PART 4)This tutorial provides the PHP & JS codes that can be pasted in order to filter your markers on a map based on terms of…Read more →Categories: Bricks, Free, PluginsTags: ACF, Animations, Filters, Isotope, Leaflet, Query Loop
Pro Parent Query Loop Object – Traversing Nested Query Loops Up in BricksBricks enables us to build nested query levels of unlimited levels. Here are a couple of examples: Sometimes, you might want to obtain the parent…Read more →Categories: Bricks, ProTags: Nested Queries
Pro Posts Grouped by Post Dates in BricksSetting up query loops for “Post Dates” with an the inner loop displaying all posts published on that day.Read more →Categories: Bricks, ProTags: Nested Queries
Pro Current Post’s Terms in BricksUpdated on 15 Jan 2024 This Pro tutorial provides the steps to set up a grid of terms (like categories) that the current post is…Read more →Categories: Bricks, ProTags: JSON Code, Query Loop, Terms Query
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 Limit the Number of Posts in a Bricks Query Loop of Relationship TypeUpdated on 12 Dec 2023 Bricks Query Loop popup does not have a control for setting the number of posts to be output when the…Read more →Categories: Bricks, ProTags: bricks/query/run, Filters, Query Loop
Pro Parent post Bricks query loopUpdated on 5 Feb 2024 In the BricksLabs Facebook group a user asks: Is there a way to output the data of a parent post…Read more →Categories: Bricks, ProTags: Query Loop