Sometimes you don’t want a particular category to appear on your WordPress home page. For me, I create weekly Twitter digests, and I’d rather they not be part of the page welcome.
The process of hiding them actually took me a little bit to figure out, so I thought I’d share. It’s rather simple, so don’t blink!
Simply edit “index.php” in the wp-content/themes/<your_theme_here>/ directory.
Between the lines:
<?php if (have_posts()) : ?>
and
<?php while (have_posts()) : the post(); ?>
Insert the line:
<?php if (is_home()) { query_posts("cat=-XXX"); } ?>
Be sure to replace “XXX” with the unique numeric ID of the category you want to ignore. To find the ID, log into your admin, navigate to your categories, and select the one you want to ignore. The number will then appear in the URL.
NOTE: Make sure you don’t delete the “-” before the “XXX” or else you will ONLY show entries from the category.
If you update your theme, you will probably have to repeat this procedure.
If you want to hide multiple categories simply append the other categories to the string with a comma: (Example: “cat=-12,-82,-4″)
It also follows, then, that this technique can also be used to hide tags, posts, etc.