【发布时间】:2011-12-19 22:05:08
【问题描述】:
我正在尝试这个:
<?php query_posts('cat=6'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<div>
<?php $counter=3; ?>
<?php the_post_thumbnail(); ?>
<?php $counter++; ?>
</div>
<?php endwhile; ?>
<?php endif; ?>
但它不起作用! :/ 谢谢!
【问题讨论】:
-
我认为这是最简单的方法:stackoverflow.com/questions/28247770/loop-through-wordpress-posts-and-wrap-each-x-post-in-a- div
标签: php wordpress loops foreach