【发布时间】:2017-01-14 00:46:23
【问题描述】:
我需要在高级自定义字段中显示循环。此代码仅返回第一张图片。
<?php if( have_rows('colors') ): ?>
<ul>
<?php while( have_rows('colors') ): the_row(); ?>
<?php $image = wp_get_attachment_image_src(get_field('colori'), 'full'); ?>
<img src="<?php echo $image; ?>" alt="<?php echo get_the_title(get_field('colors')) ?>" />
<?php endwhile; ?>
</ul>
<?php endif; ?>
【问题讨论】:
标签: wordpress advanced-custom-fields