The code below writes out a list of the most recent posts. However, it does not appear to be skipping over sticky posts although I'm using 'post_not_in' => get_option('sticky_posts'). What am I missing?
<?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>