【发布时间】:2016-04-07 02:57:06
【问题描述】:
我正在处理 ACF Flexible 内容。我正在尝试在我的灵活内容中加载图像。但是图像没有显示,只是一个损坏的图标。
为什么?
我的子字段名为“照片”
<h4 class="titrage2"><?php the_field('titre_1'); ?></h4>
<?php
if( have_rows('ateliers') ): ?>
<?php while ( have_rows('ateliers') ) : the_row(); ?>
<?php if( get_row_layout() == 'atelieratelier' ):?>
<div id="article-atelier">
<h4 class="titrage"><?php the_sub_field('atelier_01');?></h4>
<div class="article-details"><?php the_sub_field('txtimg');?></div>
<div>
<img src="<?php the_sub_field('photo'); ?>" />
</div>
</div>
<?php endif;?>
<?php endwhile;?>
<?php else :?>
<?php endif;?>
【问题讨论】:
-
你的问题是你把它设置为一个数组,并试图像一个 URL 一样拉进来。
标签: php image advanced-custom-fields