I read through previous threads on this topic, but still need help. I want to exclude two categories (15 and 16) from the Recent Posts (renamed "Latest Headlines") that appears on my home page in the top sidebar.
I went into sidebar.php and edited the code this way:
Code:
<ul id="sidebarwidgeted">
<?php if ( !function_exists('dynamic_sidebar') || !dynamic_sidebar('Sidebar Top') ) : ?>
<li id="recent-posts">
<h2>Latest Headlines</h2>
<ul>
<?php $recent = new WP_Query("cat=-15,-16&showposts=5"); while($recent->have_posts()) : $recent->the_post();?>[*]<?php the_title(); ?>
<?php endwhile; ?>[/list]
<?php endif; ?>
[/list]
But nothing shows up on the home page at all for Latest Headlines that way. If I enable the Recent Posts widget, headlines from all categories show up, which I clearly don't want.
What am I doing wrong this time? :)