• iok

    (@iok)


    Hello i want to create a carousel with bootstrap4 and the loop of teh Custom Field Suite:
    gallery_images = CFS()->get(‘gallery_images’);
    foreach ($gallery_images as $image)
    echo ‘‘;

    Can yo help me??, thanks!!

Viewing 1 replies (of 1 total)
  • Thread Starter iok

    (@iok)

    i work with this…

    <div id="carouselExampleControls" class="carousel slide" data-ride="carousel">
    
        <?php $gallery_images = CFS()->get('gallery_images')?>
        <?php $i=0; foreach ($gallery_images as $image){?>
             <?php if($i==0){ ?><div class="carousel-inner"><?php } ?>
                 <?php if($i % 2 == 0){ ?><div class="carousel-item active"><?php }?>
                      
                            <? echo '<img class="d-block w-100" src="'.$image["image"].'"/></div>'?>
                     
                            <?php if($i % 4 != 0){ ?></div><?php }?>
                          <?php $i++; } ?>
                     </div>
                   
      <a class="carousel-control-prev" href="#carouselExampleControls" role="button" data-slide="prev">
        <span class="carousel-control-prev-icon" aria-hidden="true"></span>
        <span class="sr-only">Previous</span>
      </a>
      <a class="carousel-control-next" href="#carouselExampleControls" role="button" data-slide="next">
        <span class="carousel-control-next-icon" aria-hidden="true"></span>
        <span class="sr-only">Next</span>
      </a>
    </div>
    • This reply was modified 8 years ago by iok.
    • This reply was modified 8 years ago by iok.
Viewing 1 replies (of 1 total)

The topic ‘Carousel with loop’ is closed to new replies.