Support

Account

Home Forums Add-ons Repeater Field Getting The First Two Rows of a Repeater and Then Outputting a Nested Repeater Reply To: Getting The First Two Rows of a Repeater and Then Outputting a Nested Repeater

  • Edited: answered it yourself before I could finish typing. Sometimes typing it out does help. That’s how I do my thinking most of the time.

    …..

    Maybe this code for a nested repeater stripped of all the extra stuff will help.

    
    if (have_rows('parent_repeater')) {
        while (have_rows('parent_repeater')) {
            the_row();
            if (have_rows('nested_repeater')) {
                while (have_rows('nested_repeater')) {
                    the_row();
                    $value = get_sub_field('sub_field_of_nested_repeater');
                }
            }
        }
    }
    

    So basically you have two nested loops that are identical.