Parent post Bricks query loop

Updated on 5 Feb 2024

In the BricksLabs Facebook group a user asks:

Is there a way to output the data of a parent post in a child post?

Are there tutorials for this?

This Pro tutorial provides the steps to output the current single post's parent post using a Bricks query loop for hierarchical post types.

When viewing the child post:

Step 1

Create and edit your single post type template with Bricks.

Add a Section for showing the parent post data (bottom Section in the screenshot).

Sample JSON provided near the end for copy-pasting.

Set up a query loop inside.

Click the query icon and enable PHP query editor.

Paste:

This is a BricksLabs Pro tutorial.

For full access login below or create your BricksLabs Pro account

Instant access to 390+ Bricks code tutorials with BricksLabs Pro