<?php
$query_post = array(
'posts_per_page' => 5,
'post__in' => get_option('sticky_posts'),
'caller_get_posts' => 1
);
query_posts($query_post);
?>
<?php while(have_posts()):the_post(); ?>
<div class="most-comment-posts">
<ul>
<li>
<span class="styiky-icon>置顶</span>
<a style="margin-left: 10px;" href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</li>
</ul>
</div>
<?php endwhile; ?>
<?php
wp_reset_query();
?>
通过这段代码给wp首页添加置顶,但是发现每一个翻页的顶部都显示,有没有办法只显示在首页,而不显示在翻页?