Support

Account

Home Forums Add-ons Repeater Field Wrap entire Repeater Field in a wrapper Reply To: Wrap entire Repeater Field in a wrapper

  • I solved this but maybe this might help someone! I was making it WAY harder then it was!

    Here is what I did to get a class called ‘multiple’ or wrapper around my repeater:

    <?php  //begin some repeating fields for if multiple trips to same country */
    
                elseif (get_row_layout() == 'trip_card') :  ?>
    
    <?php if (have_rows('multiple_trips')) :
                        echo '<div class="multiple">'; //begin wrapper
    
                        // loop through the rows of data
                        while (have_rows('multiple_trips')) : the_row(); ?>
    
    <?php
                            //vars
                            $first_trip_title = get_sub_field('first_trip_title');
                            $first_trip_date = get_sub_field('first_trip_date');
                            //$counter = 2;
    
                            //display a sub field value 
                            ?>
    <div><strong><?php echo $first_trip_title; ?>:</strong>
    
        <?php echo $first_trip_date; ?></div>
    
    <?php endwhile;
                        echo '</div>' ?>
    <!-- end of wrapper:  multiple -->
    <?php else : ?>
    <?php // no rows found 
                        ?>
    <?php endif; ?>