我有一個WP_Query循環,拉動4所最近發表的文章:風格的第一篇文章中WP_Query不同
<?php
$featuredPosts = new WP_Query();
$featuredPosts->query('showposts=4');
while ($featuredPosts->have_posts()) : $featuredPosts->the_post(); ?>
<div class="recentpost">
<?php echo get_the_post_thumbnail ($_post->ID, 'small'); ?>
<div class="titlerecent">
<h1><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h1>
</div>
</div>
<?php endwhile; ?>
我想要做的就是修改這個和風格的第一篇文章在不同的循環。我不只是想爲它添加一個CSS類,我想把它包裝在一個完全不同的<div>
。
所以,我想第一個帖子被包裝在<div class="homefirstpost">
,然後剩下的3個帖子如上所述,在<div class="recentpost">
內。
我需要做什麼?
注意,這在IE7中不起作用 – janw
@janw感謝您的提示。 –