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.
Tax dollars should not allow a U.S. official to make MORE than their salary
This is a cause that I have come up with, and I think it a noble one. Get more details on the Facebook group page, but the jist is:
President Obama said in his State of the Union speech last night:
I think my idea is a very simple way for him and for Congress (and others) to demonstrate that. Check it out.
Posted in Commentary, Politics