I have a query as shown below:
<?php
$query = new WP_Query( $wpplnum );
while( $query->have_posts() ): $query->the_post();
?>
<div class="carousel-item col-md-4 active">
<div class="card">
<img class="card-img-top img-fluid" src="https://placehold.it/800x600/f44242/fff" alt="Card image cap">
<div class="card-body">
<h4 class="card-title">Card 1</h4>
<p class="card-text">This is a longer card with supporting text below as a natural lead-in to additional content. This content is a little bit longer.</p>
<p class="card-text"><small class="text-muted">Last updated 3 mins ago</small></p>
</div>
</div>
</div>
I want to add the active
class only to the first loop item:
class="carousel-item col-md-4 active"
the remaining loop items will be without the active
class:
class="carousel-item col-md-4"