我正在尝试使用 ACF 和 Flexslider 2 在 Wordpress 中生成一个基本滑块。我想在左侧显示文本,在右侧显示图像,就像我在所附屏幕截图中创建的排列一样。
我希望滑块以完全相同的格式轮换出 2-3 个艺术家简介,并以蓝色背景作为滑块容器。我使用 ACF 中继器成功创建了自定义字段,其中包含名称、标题、个人简介文本和图像的子字段。我遇到的问题是,创建中继器后,flexslider 根本不显示,而是我可以一次看到所有中继器字段,如下所示: theg8.com/about-the-art/
这是我的模板文件中的 PHP:
<li class="mason__grid-col col__full artist-highlight-section">
<?php if( have_rows('artist_slider') ): ?>
<div class="col-12 artist-info">
<?php while( have_rows('artist_slider') ): the_row(); ?>
<div class="artist-info-left col-lg-6 col-md-6 col-sm-12">
<h2><?php the_sub_field('artist_name'); ?>
</h2>
<h3><?php the_sub_field('artist_title'); ?></h3>
<p><?php the_sub_field('artist_bio'); ?></p>
</div>
<div class="artist-image-right col-lg-4 col-md-6 col-sm-12">
<figure>
<?php
$image = get_sub_field('artist_image');
$imageurl = $image['sizes']['slider'];
?>
<li class="lazy"><img src="<?php echo $imageurl; ?>"></li>
</figure>
</div>
<?php endwhile; ?>
</div><!-- ends col-12 -->
<?php endif; ?>
</li>
有人能帮忙吗?
眼眸繁星