/* Mini-Features */
?>
<div id="sub-featured" class="<?php echo $main_css_class; ?> section">
<h2 class="section-title"><?php echo stripslashes( $featured_title ); ?></h2>
<?php
query_posts( \'suppress_filters=0&post_type=infobox&order=ASC&posts_per_page=\' . $mini_features_number );
if ( have_posts() ) { $count = 0; while ( have_posts() ) { the_post(); $count++;
$excerpt = stripslashes( get_post_meta( $post->ID, \'mini_excerpt\', true ) );
$button = get_post_meta( $post->ID, \'mini_readmore\', true );
$post_class = \'post block\';
if ( $count % $mini_features_count == 0 ) { $post_class .= \' last\'; }
?>
<div <?php post_class( $post_class ); ?>>
<a href="<?php echo $button; ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php woo_image( \'key=mini-image&width=300&height=150&class=thumbnail aligncenter&link=img\' ); ?></a>
<h3 class="title"><a href="<?php echo $button; ?>" rel="bookmark" title="<?php the_title_attribute(); ?>"><?php the_title(); ?></a></h3>
<?php if ( $excerpt ) { ?>
<div class="entry">
<?php echo $excerpt; ?>
</div>
<?php } ?>
</div><!-- /.post -->
<?php
if ( $count % $mini_features_count == 0 ) { echo \'<div class="fix"></div>\'; }
} // End WHILE Loop
} else {
?>
<div class="post">
<p><?php _e( \'Sorry, no posts matched your criteria.\', \'woothemes\' ); ?></p>
</div><!-- /.post -->
<?php } // End IF Statement ?>
</div><!-- /#mini-features -->
这就是代码,在其中的某个地方,我需要指定只显示sticky\\u贴子,这就是我要解开的地方。我已经查看了query\\u帖子和;sticky\\u帖子(&U);老实说,我不知道从哪里开始修改上面的内容。。。我做的第一件事是(向那些自定义帖子类型)添加一个粘性帖子元框的功能(感谢:Sticky Custom Post Types - 这很管用)。作为主题选项的一部分,我可以指定要显示的帖子数量(在我的例子中是3x),但在我修改上述代码以仅显示sticky\\u帖子之前,我最终会显示2x sticky\\u帖子(另一个随机)。我被卡住了,所以任何指点都将不胜感激!