25th Nov '22
/
1 comment

Outputting ACF Repeater’s Sub Fields

This Pro tutorial provides the code for printing custom HTML after looping through rows of a ACF Repeater (available in ACF Pro) that has a couple of Color Picker fields and a Text field.

ACF Field:

Field populated when editing a Page:

On the frontend:

The reason for providing a field for text color is that the default dark text color will not be readable if the background color is dark. A light text color can be set for such rows.

We shall set a light gray background color when the user does not pick one. Also, ensure a grayish border-color applies for such rows' output.

Step 1

Add this PHP code where you want to output the Repeater field:

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
Related Services grouped by Service Categories on Single Branch Posts in Bricks

Related Services grouped by Service Categories on Single Branch Posts in Bricks

How to query ACF relationship fields on single CPT templates.
Categories:
Pro
Customizing ACF Repeater/Relationship or Meta Box Relationship Query Parameters in Bricks

Customizing ACF Repeater/Relationship or Meta Box Relationship Query Parameters in Bricks

For query types other than post, term and user in Bricks i.e, ACF Repeater/ACF Relationship/Meta Box Relationship there are no built-in controls for modifying the…
Categories:
ACF Relationship: Count of Related Posts

ACF Relationship: Count of Related Posts

Looking to get the number of CPT B posts related to a CPT A post when using a Relationship field with ACF? Here's a custom…
Categories:
Tags:
Pro
ACF Date Field Value Custom Format in Bricks

ACF Date Field Value Custom Format in Bricks

In the Bricks forum, a user asks: Hi there, I am setting up an events calendar using bricks. In some circumstances I would like to…
Categories:
Tags:
Pro
ACF Image Data in Bricks

ACF Image Data in Bricks

Displaying Alt text, Caption, Title and URL of an ACF image field for posts in a query loop.
Categories:
Tags:
Accessing ACF Repeater Sub Fields Programmatically in Bricks Query Loop

Accessing ACF Repeater Sub Fields Programmatically in Bricks Query Loop

It is possible to output sub field's values when a Bricks query loop's type has been set to a ACF Repeater without writing code. This…
Categories:
Pro
Conditionally Hiding Bricks Filters based on Select Filter Value

Conditionally Hiding Bricks Filters based on Select Filter Value

How show or hide Bricks' filter based on the selection made by another filter.
Categories:
Tags: