Support

Account

Home Forums Add-ons Repeater Field Repeater with Foundation Orbit Slider Reply To: Repeater with Foundation Orbit Slider

  •  <ul class="orbit-container">
    
                <?php
                // check if the repeater field has rows of data
                    if( have_rows('home_page_slider') ):
                
                    $i = 0; // Set the increment variable
                
                // loop through the rows of data
                    while ( have_rows('home_page_slider') ) : $i++; the_row();
                ?>
                
                        <li class="orbit-slide loading" id="slide-<?php echo $i; ?>">
                            <div style="background-image: url(<?php if ( the_sub_field('slide_image') ) { echo 'style="background-image: url(' . the_sub_field('slide_image') . ')"'; } ?>)" class="expanded main-welcome" id="bg-n">
                                <div class="orbit-upper-content <?php the_sub_field('slider_color_scheme'); ?>">
                                    <h2><?php the_sub_field('slide_title'); ?> <span><?php the_sub_field('slide_title_highlight'); ?></span></h2> 
    
                                    <?php the_sub_field('slide_text'); ?>
                                    <?php
    
                                    // check if the repeater field has rows of data
                                    if( have_rows('link_buttons') ):
    
                                        // loop through the rows of data
                                        while ( have_rows('link_buttons') ) : the_row();
                                    ?>
    
                                            <a href="<?php the_sub_field('button_page_link'); ?>" class="button ghost-button-home <?php the_sub_field('button_color'); ?>"><?php the_sub_field('button_label'); ?></a>
                                    
                                    <?php 
    
                                        endwhile;
    
                                    else :
    
                                        // no rows found
    
                                    endif;
    
                                    ?>
                                </div>
                                
                            </div>
                        </li>
                
                <?php
                    endwhile;
    
                else :
    
                    // no rows found
    
                endif;
    
                ?>
                <div class="slide-info">
                    <div class="direction-buttons">
                        <button class="orbit-previous"><span class="show-for-sr">Previous Slide</span><i class="fal fa-chevron-left"></i></button>
                        <button class="orbit-next"><span class="show-for-sr">Next Slide</span><i class="fal fa-chevron-right"></i></button>
                    </div>
                    <span>Next Slide</span>
                    <?php
                            $i = 0;
                            while(has_sub_field('home_page_slider')):
                            echo '<div id="slide-' . $i . '"><h4>' . get_sub_field('next_slide') . '</h4></div>';
                            $i++;
                            endwhile;
                    ?>
                    
                    <p>Find out more...</p>
                </div>
            </ul>