html 从ACF数据拉出的Bootstrap Carousel
Posted
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了html 从ACF数据拉出的Bootstrap Carousel相关的知识,希望对你有一定的参考价值。
<div class="carousel fade-carousel slide" data-ride="carousel" data-interval="8000" id="bs-home-carousel">
<!-- Overlay -->
<div class="overlay"></div>
<!--<ol class="carousel-indicators">
<?php
$i=0;
while( have_rows('home_carousel') ): the_row();
if ($i == 0) {
echo '<li data-target="#bs-home-carousel" data-slide-to="0" class="active"></li>';
} else {
echo '<li data-target="#bs-home-carousel" data-slide-to="'.$i.'"></li>';
}
$i++;
endwhile; ?>
</ol>-->
<!-- Wrapper for slides -->
<div class="carousel-inner">
<?php
$z = 0;
while( have_rows('home_carousel') ): the_row();
$image = wp_get_attachment_image_src(get_sub_field('image'), 'full'); ?>
<div class="item slides <?php if ($z==0) { echo 'active';} ?>">
<img src="<?php the_sub_field('image'); ?>" style="" />
<div class="home-carousel-caption">
<hgroup>
<h2 class="line-one" style="background: <?php the_sub_field('color-picker'); ?>"><?php the_sub_field('line-one');?></h2><br />
<h2 class="line-two" style="background: <?php the_sub_field('color-picker'); ?>"><?php the_sub_field('line-two');?></h2>
</hgroup>
</div>
</div>
<?php
$z++;
endwhile; ?>
</div>
<!-- Controls -->
<a class="left carousel-control" href="#bs-home-carousel" role="button" data-slide="prev">
<span class="glyphicon glyphicon-chevron-left" aria-hidden="true"></span>
<span class="sr-only">Previous</span>
</a>
<a class="right carousel-control" href="#bs-home-carousel" role="button" data-slide="next">
<span class="glyphicon glyphicon-chevron-right" aria-hidden="true"></span>
<span class="sr-only">Next</span>
</a>
</div>
以上是关于html 从ACF数据拉出的Bootstrap Carousel的主要内容,如果未能解决你的问题,请参考以下文章
php 将youtube缩略图和网址拉出ACF oEmbed字段以供使用
php 将youtube缩略图和网址拉出ACF oEmbed字段以供使用
php 使用ACF Gallery Field的Bootstrap Carousel
php Bootstrap 4手风琴| Laravel和ACF
Bootstrap Modal 和 ACF Repeater 字段
从 WooCommerce 购物车中的产品中获取 ACF 图像字段的数据