Create Custom Menu in WordPress Dashboard
Complete tutorial on create custom menu in wordpress dashboard. Discover practical examples, implementation tips, and expert advice for WordPress and WooCo
Read More →
Advanced Custom Fields (ACF) enables you to attach flexible, repeatable field groups to your WordPress posts and pages. One of the standout features is the repeater field. This tutorial explains how to fetch and display repeater field data using have_rows() and the_row().
Let’s say you have a repeater named "my_repeater_field" containing two subfields: "sub_field_1" and "sub_field_2". Here's how you can loop through and display them:
Use have_rows() to check for rows before starting the loop:
<?php
if (have_rows('my_repeater_field')) {
while (have_rows('my_repeater_field')) {
the_row();
$sub_field_1_value = get_sub_field('sub_field_1');
$sub_field_2_value = get_sub_field('sub_field_2');
echo 'Subfield 1: ' . $sub_field_1_value . '<br>';
echo 'Subfield 2: ' . $sub_field_2_value . '<br>';
}
}
?>
Inside the loop, use get_sub_field() to pull values from each subfield:
get_sub_field('sub_field_1') – returns the value of the first subfield.get_sub_field('sub_field_2') – returns the value of the second subfield.You can repeat this pattern for more subfields within the repeater group.
Repeaters are ideal for structured data like team listings, FAQs, or grouped content blocks. With a few lines of code, you can make your site dynamic and manageable.
Now you're ready to leverage ACF repeater fields effectively in your projects! 
Search our archives or reach out to our team for solutions and expert advice.