我想這一點:Wordpress循環:如何將每個3個職位包裝到一個div?
<?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 –