I have a function below whose purpose is to create a listing of posts where the category assigned to each post is "top-menu". However, I first want to exclude any posts where the category is "hidden"...
How can I edit this code to do that?
global $post;
$cat = get_cat_ID('top-menu');
if ($cat > 1)
$myposts = get_posts('numberposts=5&category='.$cat);
else
$myposts = get_posts('numberposts=10');
foreach ($myposts as $post) :
?>
<li>
<a href="<?php the_permalink(); ?>">
<?php the_title(); ?>
</a>
</li>
<?php endforeach; ?>