Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR PHP

bootstrap carousel foreach loop not working 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
 
PREVIOUS NEXT
Tagged: #bootstrap #carousel #foreach #loop #working #wordpressp #php #wp
ADD COMMENT
Topic
Name
6+6 =