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 Pro members-only tutorial.

To get full access, login below or sign up for a Pro Account

Leave your comment