I am using the standard wordpress loop that looks like:
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h2><?php the_title(); ?></h2>
<?php endwhile; else: ?>
<h2>We're sorry...there is no content.</h2>
<?php endif; ?>
Then, what I wanted to do was exclude a certain category from my query, so my code became:
<?php
$parent = get_cat_ID("Sports");
query_posts("cat=-".$parent);
?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<h2><?php the_title(); ?></h2>
<?php endwhile; else: ?>
<h2>We're sorry...there is no content.</h2>
<?php endif; ?>
<?php wp_reset_query(); ?>
Which I thought was right on the money...
So I did some research and discovered this is only excluding the category, not the category and it's subcategories. Is there a way to exclude a specific category and all it's subcategories from the loop?
Thanks, Josh