Display ACF repeater field

662

Last updated

Added

Informations

This code allows you to loop over a ACF repeater field and display its subfields.

Code

<?php if(have_rows(‘field_name’)) : ?>

  <?php while(the_repeater_field(‘field_name’)) : ?>

 

      <?php the_sub_field(‘subfield_name’); ?>

 

  <?php endwhile; ?>

<?php else : ?>
<!–– If the repeater is empty, this part will be displayed ––>
<?php endif; ?>

Contribute to this page

Votre adresse e-mail ne sera pas publiée. Les champs obligatoires sont indiqués avec *