Php 显示带有子字段的帖子数量的类
我正在使用wordpress插件转发器。我希望每个sub_field post(在本例中从LI开始)都有自己的项目计数器 第一个项目是一类,第二个项目是两类,依此类推Php 显示带有子字段的帖子数量的类,php,wordpress,advanced-custom-fields,Php,Wordpress,Advanced Custom Fields,我正在使用wordpress插件转发器。我希望每个sub_field post(在本例中从LI开始)都有自己的项目计数器 第一个项目是一类,第二个项目是两类,依此类推 <?php while( has_sub_field('home_panels') ): ?> <li class="item" data-factor="1"> <a href="<?php the_sub_field('panel_link'); ?>"> <
<?php while( has_sub_field('home_panels') ): ?>
<li class="item" data-factor="1">
<a href="<?php the_sub_field('panel_link'); ?>">
<img src="<?php the_sub_field('panel_image'); ?>" />
<div class="caption">
<div>
<div>
<h3><?php the_sub_field('panel_title'); ?></h3>
<span class="excerpt"><?php the_sub_field('panel_description'); ?></span>
</div>
</div>
</div>
</a>
</li>
<?php endwhile; ?>
<?php $i = 0; while( has_sub_field('home_panels') ): $i++; ?>
<li class="item item-<?php echo $i; ?>" data-factor="1">