🎉 Launch Party!

discount for all licences until Aug 31.

Buy now →

Repeater field

The repeater field lets you define a set of fields that user can fill multiple times.

The repeater field is useful for creating a list of items based on the same fields, for example listing the members of a team.

The repeater field lets you list items without turning them into pages, as would be the case with a Custom Post Type. It is therefore better suited for cases where the listed items do not need a dedicated URL.

This field is only available in the pro versions of Modern Fields.

Configuration

Go to Modern Fields > Field groups and create a new group. Insert the Repeater block.

The repeater field acts as a container, allowing you to insert fields inside it.

You can arrange the inner fields by using columns, rows and grid inside the repeater.

Use columns, rows and grid to arrange your fields inside the repeater

Several options are available for the repeater field:

Effect
“Add button” labelDefine the label of the bottom button. Eg: add a team member.
Min rowsThe minimum number of items expected.
Max rowsThe maximum number of items expected.
Row stylesDefine the background and border color of the repeater container.
The available field options

Use the repeater field

The repeater field is easy to use: click on the “Add button” to add a new row of fields. You can delete a row by clicking the trash bin icon on the right of the row.

You can also reorder items by dragging them by the handle on the left of the row.

The repeater field in action

Display values with PHP

For now, you’ll need to use PHP to display the repeater values. We plan to add a dedicated blocks in the near future.

The easiest way is to first register a custom block with Modern Fields.

In the template, get the field value and loop through it:

PHP
mf-blocks/my-block.php

You can also display a repeater values in a standard PHP context:

PHP

In this example, get_field() is the shorthand function you can enable in Modern Fields settings.


Relation field

Conditional logic