Hi guys im using WP advanced custom fields pro repeater function, trying get my bootstrap slider to work with advanced custom fields. here is my ACF set up
ACF setup WP side
and here is my bootsrap code with ACF integrated.
my code
<section class="pb-5">
<div class="container">
<div id="carousel_03" class="carousel slide" data-ride="carousel">
<div class="row">
<div class="col-lg-4">
<ol class="carousel-indicators tabs row">
<li class="col-lg-12 col-sm-6 mb-2 active">
<div data-target="#carousel_03" data-slide-to="0" role="button" class="carousel-indicator p-3">
<h4 class="mb-1">one</h4>
</div>
</li>
<li class="col-lg-12 col-sm-6 mb-2">
<div data-target="#carousel_03" data-slide-to="1" role="button" class="carousel-indicator p-3">
<h4 class="mb-1">two</h4>
</div>
</li>
<li class="col-lg-12 col-sm-6 mb-2">
<div data-target="#carousel_03" data-slide-to="2" role="button" class="carousel-indicator p-3">
<h4 class="mb-1">three</h4>
</div>
</li>
<li class="col-lg-12 col-sm-6 mb-2">
<div data-target="#carousel_03" data-slide-to="3" role="button" class="carousel-indicator p-3">
<?php
if( have_rows('slider') ):
while ( have_rows('slider') ) : the_row();
the_sub_field( 'title');
?>
<h4 class="mb-1"><?php the_sub_field($section . 'title') ?></h4>
<?php
endwhile;
endif;
?>
</div>
</li>
</ol>
</div>
<div class="col-lg-8 mb-3">
<div class="carousel-inner">
<div class="carousel-item active">
<img src="some.svg" class="d-block w-100" alt="alt">
</div>
<div class="carousel-item">
<img src="some.svg" class="d-block w-100" alt="alt">
</div>
<div class="carousel-item">
<img src="some.svg" class="d-block w-100" alt="alt">
</div>
<div class="carousel-item">
<?php
if( have_rows('slider') ):
while ( have_rows('slider') ) : the_row();
the_sub_field( 'image');
?>
<img class="img-fluid"
src="<?php the_sub_field($section . 'image') ?>"
alt="<?php the_sub_field($section . 'alt') ?>">
<?php
endwhile;
endif;
?>
</div>
</div>
<a class="carousel-control-prev" href="#carousel_03" role="button" data-slide="prev">
<span class="carousel-control-prev-icon" aria-hidden="true"></span>
<span class="sr-only"></span>
</a>
<a class="carousel-control-next" href="#carousel_03" role="button" data-slide="next">
<span class="carousel-control-next-icon" aria-hidden="true"></span>
<span class="sr-only"></span>
</a>
</div>
</div>
</div>
</div>
</section>
My aim for less code and to have ACF to pull all images for the slider in the correct order.
My problem
as I currently do not have my images in a array they all display where I cal my sub field, whats the best solution to get this working correctly ?