27th Jul '24
/
7 comments

ACF Flexible Content Field – Layout Labels and Sub Field Labels

Updated on 28 Jul 2024

This Pro tutorial provides the steps to output the text of layout labels and/or sub field labels when using the Flexible Content field of Advanced Custom Fields Pro.

Consider this sample field group:

Generally speaking, it is okay to hardcode these texts, but there could be some situations where you want to pull the labels dynamically. This means that if the labels are changed in the field group, the labels will automatically update on the front end without having to manually change the labels in the template/builder to match the updated text.

Update: A JSON export of the field group and JSON code of the fully-built Section from our dev site are provided near the end.

Layout Labels

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

Get access to all 610 Bricks code tutorials with BricksLabs Pro

Related Tutorials..

Pro
Merging ACF Gallery Images with Featured Image in Bricks

Merging ACF Gallery Images with Featured Image in Bricks

Updated on 12 Mar 2025 In the Bricks Facebook group a user asks: Merging images from different fields into a single gallery Hi, I have…
Categories:
Pro
ACF Font Awesome Field in Bricks

ACF Font Awesome Field in Bricks

We walk through using the Advanced Custom Fields: Font Awesome Field plugin for showing Font Awesome icons.
Categories:
Tags:
Pro
Filtering posts by a group field’s true / false field sub field value with ACF or Meta Box in Bricks

Filtering posts by a group field’s true / false field sub field value with ACF or Meta Box in Bricks

This Pro tutorial covers how posts of a Bricks query loop can be filtered to show only the ones whose true / false or checkbox…
Categories:
Tags:
Pro
Sub Field Value from the Last ACF Repeater Row in Bricks

Sub Field Value from the Last ACF Repeater Row in Bricks

Getting the value of a specific sub field of an ACF Pro‘s Repeater field and output in the query loop.
Categories:
Tags:
Pro
Querying Posts by Date/Datetime Custom Fields in Bricks

Querying Posts by Date/Datetime Custom Fields in Bricks

This Pro tutorial shows how to configure ACF and Meta Box to query posts in Bricks by custom field(s) of the type Date/Date Time Picker…
Categories:
Tags:
Pro
ACF Relationship Select Filter in Bricks

ACF Relationship Select Filter in Bricks

In the BricksLabs Facebook group, a user asks: I'm learning about ACF relationships and attempting to output a list of posts on any given page,…
Categories:
Pro
Conditional Output Based on ACF Date Field in Bricks

Conditional Output Based on ACF Date Field in Bricks

Updated on 1 Aug 2024 Looking to have a Section or other elements in Bricks rendered on the frontend only if today's date is before…
Categories: