0
我正在使用高级定制字段并在中继器中有中继器。我需要嵌套的中继器随机抽取一行。这里是我有什么不工作:中继器中的随机中继器高级定制字段
<?php $i = 0; while(the_repeater_field('squares')): ++$i;
$repeater = get_sub_field('images');
$rand = rand(0, (count($repeater) - 1));?>
<a href="<?php the_sub_field('link'); ?>" class="fs-square" style="background-image:url('<?php echo $rand['four-square']; ?>')">
<div class="main-text"><?php the_sub_field('main_text'); ?></div>
<div class="icon-section">
<div class="icon"><?php the_sub_field('icon'); ?></div>
<div class="icon-text"><?php the_sub_field('icon_text'); ?></div>
</div>
</a>
<?php endwhile; ?>
基本上,我有一个正方形的中继器,然后在我对图像的中继器。我需要图像中继器是随机的。