WordPress文章置顶功能的一些应用代码

<?php
$sticky = get_option('sticky_posts');
rsort( $sticky );
$sticky = array_slice($sticky, 0, 9);
query_posts( array( 'post__in' => $sticky, 'caller_get_posts' => 1 ) );
while (have_posts()) : the_post();  php endwhile;?>

原文地址:https://www.cnblogs.com/huangtailang/p/2453762.html