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 full access to all 220+ Bricks tutorials with BricksLabs Pro

1 comment

Leave your comment