Warning: file_get_contents(/data/phpspider/zhask/data//catemap/0/assembly/5.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Php 使用while循环在5列引导转盘中显示无限数据_Php_Carousel - Fatal编程技术网

Php 使用while循环在5列引导转盘中显示无限数据

Php 使用while循环在5列引导转盘中显示无限数据,php,carousel,Php,Carousel,有没有办法创建一个包含5列的引导转盘,并使用while循环输出所有图像? 它如何处理行和列? 这是我的while循环: <?php if( have_rows('logos') ): ?> <?php while( have_rows('logos') ): the_row(); // vars $image = get_sub_field('logo_image'); $content = get_sub_field('

有没有办法创建一个包含5列的引导转盘,并使用while循环输出所有图像? 它如何处理行和列? 这是我的while循环:

  <?php if( have_rows('logos') ): ?>

<?php while( have_rows('logos') ): the_row(); 
        // vars
        $image = get_sub_field('logo_image');
        $content = get_sub_field('name');
?>
<div class="item active">
  <a href="#"><img src="<?php echo $image['url']; ?>"></a>
<?php endwhile; ?>
<?php endif; ?>

以下是示例:

 <?php if( have_rows('logos') ): ?>
<div class="row">
<?php while( have_rows('logos') ): the_row(); 
        // vars
        $image = get_sub_field('logo_image');
        $content = get_sub_field('name');
?>
  <div class="item active col-2">
    <a href="#"><img src="<?php echo $image['url']; ?>"></a>
  </div>

<?php endwhile; ?>
</div>
<?php endif; ?>

:

使用.col-表示超小的
示例:col-2,
col-6

对于较小的
≥576px
==>示例:.col-sm-2 ,col-sm-6

使用.col md-作为介质
≥768px
==>示例:.col-md-2 ,col-md-6

对于较大的
≥992px
==>示例:.col-lg-2 ,col-lg-6

对于超大的
≥1200px
==>示例:.col-xl-2 ,.col-xl-6


引导网格有12个,所以12/5=2.5,所以您可以选择使用col-2或col-3,但您可以有另一种解决方法,即在主样式CSB中覆盖col-2或col-3宽度,但它如何与while循环一起工作?我应该把col-2或col-3放在哪里?你能给我举个例子吗?你用的是哪个引导版本?