我很快就要把它付诸实施了,但我有一个悬而未决的问题。
特色帖子代码在每篇帖子之前/之后不断重复
NEW CODE per CHIP
<?php
// Define featured posts query
$featured_query = new WP_Query( array(
\'posts_per_page\' => 3,
\'category_name\' => \'featured\'
) );
// Open featured posts loop
if ( $featured_query->have_posts() ) :
while ( $featured_query->have_posts() ) : $featured_query->the_post();
// Featured posts loop markup goes here
?>
<div class="featureportfolio<?php echo $i++;?>">
<a href="<?php the_permalink() ?>" rel="bookmark" class="title">
<?php the_post_thumbnail(\'thumbnail\'); ?></a>
<div class="info">
<a href="<?php the_permalink() ?>" rel="bookmark" class="title"><?php the_title(); ?></a>
</div>
</div>
<?php
// Close featured posts loop
endwhile;
endif;
// Clear/spacer DIV
?>
<div class="clear"></div>
这“有效”减去了现在主页上只显示特色帖子的事实。