Setting up a carousel slideshow

3 posts by 2 authors in: Forums > CMS Builder
Last Post: April 20, 2021   (RSS)

By Toledoh - April 19, 2021

I normally just use a "counter", so for every loop a variable gets higher.  If the variable is zero, then show the "active".

ie.

<?php $count=0 ?>

<?php foreach ($homepage_slideshowRecords as $record): ?>
<div class="item <?php if (!$count): ?>active<?php endif ?>">

<?php $count++ ?>

<?php endforeach ?>

Cheers,

Tim (toledoh.com.au)

Thanks for this, Tim.  It worked perfectly. http://stgeorgesnewhamburg.com/home.php