Support

Account

Home Forums Front-end Issues Change column size based on amount of elements (repeater fields) Reply To: Change column size based on amount of elements (repeater fields)

  • instead on using the_sub_field() use get_sub_field() for the values and check to see that each has a value.

    I’m not really sure how to do this by looking at your code. If I’m getting what you’re doing right then if you’re looking at the first item for the row then you need to look ahead to the next row and that’s not something that possible using a have_rows loop. Instead what you’ll need to do is get the entire repeater into an array and loop over the array instead.

    
    // this will show you what's in the repeater
    $rows = get_field('columns_carousel_slide');
    echo '<pre>'; print_r($rows); echo '</pre>';