Support

Account

Home Forums Add-ons Repeater Field ACF Repeater max 6 items display inside table Reply To: ACF Repeater max 6 items display inside table

  • You’re not going to be able to do this without some extremely complex coding.

    Is there a reason that you’re using a table?

    If a table is the only way you can do this then I would suggest putting each row of the repeater into html and then output that html in the order you want based on the number of rows.

    
    $row_html = array();
    while(have_rows('repeater')) {
      the_row();
      $index = get_row_index();
      $row_html[$index] = '<div>';
      $row_html[$index] .= get_sub_field('my_sub_field');
      $row_html[$index] .= '</div>';
    }
    

    You’ll still need some creative logic, but at least you won’t be trying to do it inside of the loop.