Show Gallery Image As Slider And Add Class

<?php $images2 = get_field(‘slider_gallery’,$post->ID); $count=1;
if( $images2 ):
$counter = 0;
?>

<?php foreach( $images2 as $image2 ): ?>
<?php $class = ”;
if(++$counter == 1) {
$class = ‘active’;
}
else {
$class == ”;
}

?>

<?php echo $class ; ?>”>

“<?php echo $image2[‘slider_image’]; ?>” alt=”” />

<h4><?php echo $image2[‘slider_heading’]; ?></h4>
<p><?php echo $image2[‘slider_text’]; ?></p>

<?php endforeach; ?>
<?php endif; ?>

Advertisements