excluding category from posts
-
Hi —
Just upgraded to 2.0 all is smooth except one little thing.In 1.x versions I was organizing my front page like this:
—–
Sticky Message
—–Main set of posts
—–
Linkspam posts (short entries mostly, er, links)
—–This was achieved with this code:
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<?php if ( in_category('21') ) { ?>
<?php the_content(); ?>
<?php } ?>
<?php endwhile; ?>
<?php rewind_posts(); ?>
<?php while (have_posts()) : the_post(); ?>
<?php if ( !(in_category('17')) && is_home() ) { ?>
—
the posting code chunk
—
<h3>LinkSpam</h3>
<?php rewind_posts(); ?>
<?php while (have_posts()) : the_post(); ?>
<?php if ( in_category('17') ) { ?>
<div class="linky" style="background:pink;border-bottom:2px solid purple;"><?php the_content(); ?></div>
<?php } ?>
<?php endwhile; ?>
The first and last sections of this are working fine, pulling out only the category defined. The middle is not excluding the category defined.
Any thoughts? TIA
<ignore my template and organization… it’s transition time for a lot of things. :)>
- The topic ‘excluding category from posts’ is closed to new replies.