Support

Account

Home Forums Add-ons Repeater Field Cant get 2 loops of 1 repeater to load

Helping

Cant get 2 loops of 1 repeater to load

  • Seen 1 or 2 others with a similar issue, but not sure if they ever got resolved, or their solutions didnt work for me.

    Similar to others, trying to output 2 of the same loop.
    One loop to output the Tabs at the top of the page
    Second loop to output the content further down the page

    Does the first loop need to be reset? If so, how/where, and whats the correct way to do this?
    Ive seen reset_rows() mentioned often, but this simply breaks the page completely.

    if( have_rows('product_categories') ):
        while ( have_rows('product_categories') ) : the_row();
           // Loop 1 content
        endwhile;
    endif;
    
    // 2nd Loop
    if( have_rows('product_categories') ):
        while ( have_rows('product_categories') ) : the_row();
           // Loop 2 content
        endwhile;
    endif;
  • 
    if( have_rows('product_categories') ):
        while ( have_rows('product_categories') ) : the_row();
           // Loop 1 content
        endwhile;
    endif;
    
    reset_rows();
    
    // 2nd Loop
    if( have_rows('product_categories') ):
        while ( have_rows('product_categories') ) : the_row();
           // Loop 2 content
        endwhile;
    endif;
    
Viewing 2 posts - 1 through 2 (of 2 total)

The topic ‘Cant get 2 loops of 1 repeater to load’ is closed to new replies.