【发布时间】:2020-10-27 04:34:37
【问题描述】:
我正在尝试使用 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>
有人可以帮忙吗?
【问题讨论】:
标签: php wordpress advanced-custom-fields flexslider