主题有点说这一切。我只需要拉入ACF转发器字段的前两个字段。Wordpress ACF中继器字段 - 只需拉入前2个字段
这是我想使用,但它显然是不对的:
<?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; ?>
我应该怎么做呢?
你试图显示什么字段?当你说你只想要前两个字段时,这是否意味着中继器的前两行? – Jrod