下面的代码列出了最近的帖子列表。然而,虽然我使用了“post\\u not\\u in”=>get\\u选项(“sticky\\u posts”),但它似乎并没有跳过粘性帖子。我错过了什么?
<?php
$cat=get_cat_ID(\'top-menu\');
$catHidden=get_cat_ID(\'hidden\');
$myquery = new WP_Query();
$myquery->query(array(
\'cat\' => "-$cat,-$catHidden",
\'post_not_in\' => get_option(\'sticky_posts\')
));
$myrecentpostscount = $myquery->found_posts;
if ($myrecentpostscount > 0)
{ ?>
<div><h4>Recent Posts</h4>
<ul>
<?php
global $post;
$current_page_recent = get_post( $current_page );
$myrecentposts = get_posts(array(\'post_not_in\' => get_option(\'sticky_posts\'), \'cat\' => "-$cat,-$catHidden",\'numberposts\' => $cb2_recent_count));
foreach($myrecentposts as $idxrecent=>$post) {
?>
<li><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></li>
<?php
}
?></ul></div>