Skip to content
Controls

Repeater

Repeater control lets you create dynamic groups of controls that users can add multiple times. Perfect for creating lists, slides, or any repeatable content structure.

Repeater Control

All controls except Inner Blocks can be used inside a repeater. This lets you create flexible and complex data structures.

Control Settings

  • Row Label - Text shown for each row. Supports dynamic values:
    • {{#}} - Row number
    • {{control_name}} - Inner control value
  • Add Button Label - Custom text for the add row button
  • Minimum Rows - Required number of rows
  • Maximum Rows - Limit maximum number of rows
  • Collapsible Rows - Enable row collapsing

Usage Examples

Basic List

PHP
<ul class="items-list">
  <?php foreach( $attributes['control_name'] as $item ): ?>
    <li>
      <?php echo esc_html( $item['title'] ); ?>
      <p><?php echo esc_html( $item['description'] ); ?></p>
    </li>
  <?php endforeach; ?>
</ul>
Handlebars
<ul class="items-list">
  {{#each control_name}}
    <li>
      {{title}}
      <p>{{description}}</p>
    </li>
  {{/each}}
</ul>

Post Meta

Post Meta
<?php
$items = get_lzb_meta( 'control_meta_name' );
 
if ( $items ) : ?>
  <ul class="items-list">
    <?php foreach ( $items as $item ) : ?>
      <li>
        <?php echo esc_html( $item['title'] ); ?>
        <p><?php echo esc_html( $item['description'] ); ?></p>
      </li>
    <?php endforeach; ?>
  </ul>
<?php endif; ?>

Nested Repeaters

Nested repeaters (repeater inside repeater) are not supported and may cause unexpected behavior. This is a technical limitation that we're aware of.

Instead of nested repeaters, consider these alternatives:

  • Use separate repeaters
  • Split content into multiple blocks
  • Use custom controls for specific use cases

Use meaningful row labels with dynamic values to help users identify content: Slide {{#}}: {{title}}

Was this article helpful?