Hi, I am having problems with the ID of a carousel in the integration of an html in wordpress, what I am doing is putting the Carousel inside repetaer ACF custom field. The same carousel will be repeated several times but with different content, the problem is that it does not rotate what I charge that are images, how can I make it work? The only thing that the carousel will show is an image that I call from a custom field "gallery_image"
$(document).ready(function() {
$('#media').carousel({
pause: true,
interval: false,
});
});
<?php
// check for rows (parent repeater)
if( have_rows('localidades_prov') ): ?>
<?php // loop through rows (parent repeater)
while( have_rows('localidades_prov') ): the_row(); ?>
<article class="localidad">
<?php the_sub_field('titulo_localidad'); ?>
<p><strong>Técnico Local:</strong> <?php the_sub_field('tecnico_local'); ?></p>
<?php
// check for rows (sub repeater)
$active = "active";
if( have_rows('galeria') ): ?>
<div class="carousel slide media-carousel" id="media">
<?php
// loop through rows (sub repeater)
while( have_rows('galeria') ): the_row(); ?>
<div class="carousel-inner">
<div class="item <?php echo $active; ?>">
<div class="row">
<div class="col-md-12">
<img style="width: 100%" src="<?php the_sub_field('galeria_imagen'); ?>"/>
</div>
</div>
</div>
</div>
<a data-slide="prev" href="#media" class="left carousel-control">‹</a>
<a data-slide="next" href="#media" class="right carousel-control">›</a>
<?php $active = ''; ?>
<?php endwhile; ?>
</div>
<?php endif; //if( get_sub_field('galeria') ): ?>
</article>
<?php endwhile; // while( has_sub_field('localidad') ): ?>
<?php endif; // if( get_field('localidad') ): ?>