I read the https://codex.www.ads-software.com/The_Loop file. It says that “If the post is in the category we want to exclude, we simply pass to the next post.”
<?php if (in_category('3')) continue; ?>
So I’m trying to exclude the Posts in the “NEWS” gategory from displaying in the main “entry” div, and to display in the second sidebar.
The_Loop file also says that “Get the last 10 posts in the special_cat category.” Like this:
<?php query_posts('category_name=special_cat&showposts=10'); ?>
I try to put that in my second sidebar, but I cant do any of this.
My index.php looks like this.
<div id="content" class="narrowcolumn">
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php if (in_category('NEWS')) continue; ?>
<div class="post">
<h3 id="post-<?php the_ID(); ?>"><?php the_title(); ?> <cat><?php the_category(', ') ?></cat></h3>
<div style='border-bottom:1px #aaa solid;width:100%;'>
<div class="entry">
<?php the_content('More ↓'); ?>
</div>
</div>
<?php endwhile; ?>
So how to include and exclude categories?
Thanks