Bootstrap Carousel Foroach Loop no funciona WordPressp PHP WP

//Bootstrap
//If you can not change slide on prev, next button click,
//it may be because you have not set class="active" with class="carousel-item" on basis of foreach loop on class="carousel-item"
//so use,

  <div class="carousel-item <?php echo $key == 0 ? "active" : "" ?>">
  
//so,  on page load, crousel will be active only for first slide
Handsome Horse