Repeater in ACF Plugin – WordPress

  • The main usage of this section is, it provides a neat solution for repeating content.
  • eg. Slides, Employee details, …. etc.
  • This field type acts as a parent to a set of subfields that can be repeated again and again.
  • Sub Fields : Defines the set of repeatable subfields.
  • Collapsed : Enables each row to be collapsed by specifying a single subfield to display.
  • Minimum Rows : Sets a limit on how many rows of data are required.
  • Maximum Rows : Sets a limit on how many rows of data are allowed.
  • Layout : Defines the layout style of the appearance of the sub fields.
    • Table: Sub fields are displayed in a table. Labels will appear in the table header.
    • Block: Sub fields are displayed in blocks, one after the other.
    • Row: Sub fields are displayed in a two-column table. Labels will appear in the first column.
  • Button Label : The text shown in the ‘Add Row’ button.

To fetch data:

if( have_rows('child_repeater') ):
            while( have_rows('child_repeater') ) : the_row();

                // Get sub value.
                $child_title = get_sub_field('child_title');

            endwhile;
        endif;

Leave a comment

Your email address will not be published. Required fields are marked *