Support

Account

Home Forums Add-ons Repeater Field Wrapping first five repeater items in one div, all others into other div Reply To: Wrapping first five repeater items in one div, all others into other div

  • You can use an if statement as follows:

    <?php

    $i = 0;
    if(have_rows(‘repeater_name){
    while(have_rows(‘repeater_name’)){
    the_row();
    $i++;
    if($i=1){
    <div>
    }
    // output your normal data between here
    if($i<=5){
    </div>
    }
    }
    }

    ?>