Current Single Post Reference From Inside a Bricks Query Loop

Updated on 16 May 2024

When working on advanced customizations in Bricks, sometimes it is necessary to get a handle of the current single post (of any post type) in which a query loop is present from inside the query loop.

Sample use case: Get the single post's custom field (like ACF Repeater or Meta Box Group) array row corresponding to the loop's counter/index. An application of this will be shared in another detailed tutorial.

This Pro tutorial covers 3 ways of going about this.

Method 1

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Get access to all 525 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Posts from Random Categories in Bricks

Posts from Random Categories in Bricks

Updated on 31 Jul 2023 In BricksLabs Facebook group a user asked: How would you query 3 WordPress posts from 3 different categories with Brick…
Pro
Post Data for the Current User in Bricks with Meta Box

Post Data for the Current User in Bricks with Meta Box

In the Bricks Facebook group a user asked: I need help with Metabox and Bricks! I have created a CPT "SalesRep" with multiple custom fields…
Categories:
Pro
Dynamic Posts Lightbox in Bricks using GLightbox

Dynamic Posts Lightbox in Bricks using GLightbox

Steps to set create a dynamic lightbox with content from the post inside of the query loop.
Categories:
Pro
Posts Grouped by Authors in Bricks

Posts Grouped by Authors in Bricks

This Pro tutorial for Bricks users provides the steps to loop through users and inside that, through posts whilst setting the inner query's author parameter…