【发布时间】:2017-03-17 16:16:07
【问题描述】:
主题有点说明一切。我只需要拉入 ACF 转发器字段的前两个字段。
这是我正在尝试使用的,但显然不正确:
<?php $args = [ 'posts_per_page' => 2, 'order' => 'desc']; ?>
<?php $ar = new WP_Query( $args ); ?>
<?php if( $ar->have_rows('prodImgs') ): while ( $ar->have_rows('prodImgs') ) : $ar->the_row(); ?>
<img src="<?php the_sub_field('prodImg'); ?>" alt="">
<?php endwhile; ?>
<?php endif; ?>
我该怎么做?
【问题讨论】:
-
您要显示哪些字段?当您说您只想要前 2 个字段时,这是否意味着转发器的前两行?
标签: wordpress repeater advanced-custom-fields