Hi. I'm upgrading to 2.0 and can't seem to find a way to hide posts from one category on the main page. Any ideas? Thanks.
Hi. I'm upgrading to 2.0 and can't seem to find a way to hide posts from one category on the main page. Any ideas? Thanks.
In your main page index.php, ther is a loop for presenting your latest posts. It starts something like this:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
Immediately below that line, if you put this condition:
<?php if ( !(in_category('4')) || !is_home() ) { ?>
you will exclude posts from category number 4 form sjowing up on the main page.
What it says is:
If it is not from category 4 or if it is not on the main page, display it.
( is_home = true for the main page )
Hi. I've tried that and I get a parse error on that line. Is there another way to do this?
Did you close the if-statement with <?php }; ?> ?
Why don't you just use the private feature on the post/edit page?
This topic has been closed to new replies.