ACF Repeater Field

Posted on: May 13th, 2024
By: Tadeo Martinez

Here’s the official documentation for ACF repeater field but below is the basic snippet you need.

// Check rows exists.
if( have_rows('repeater_field_name') ):

    // Loop through rows.
    while( have_rows('repeater_field_name') ) : the_row();

        // Load sub field value.
        $sub_value = get_sub_field('sub_field');
        // Do something, but make sure you escape the value if outputting directly...

    // End loop.

// No value.
else :
    // Do something...

Have any questions or comments? Write them below!

Leave a Reply

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