我们可以计算WordPress循环并将其存储在变量中吗?
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php $post_id = get_the_ID(); ?>
<?php get_template_part(\'content\',\'home\'); ?>
some code to be executed
<?php endwhile; ?>
<?php endif; ?>
我想要的是,对于每5篇文章,应该执行提取的ceratin代码(示例新闻稿)→ 这意味着在循环中,每隔5h、10th、15th、\\uuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuuu无限个帖子(5n,n>=1)应该执行代码。