<?php
/**
 * Template part for front page slider
 */
?>
<?php

$slider = [ 'image','title'];
// check if the repeater field has rows of data
if( have_rows('slider','option') ):?>

    <div id="home_slider" class="owl-carousel owl-theme home-slider">
        <?php

        // loop through the rows of data
        while ( have_rows('slider','option') ) : the_row();
            foreach ($slider as $v) {
                $$v = get_sub_field( $v, 'option' );
            }?>

            <div class="item home-slider__item"> 
                <img src="<?php echo $image;?>" alt="" class="home-slider_img">
                <p class="home-slider__caption"><?php echo $title;?></p>
            </div>
        <?php endwhile;?>
     </div>
<?php else :

    // no rows found

endif;

?>