This seems to work pretty well, but is this still the best method of hiding categories on the front page?
I ask because in the options, my-hacks.php is called "legacy".
This seems to work pretty well, but is this still the best method of hiding categories on the front page?
I ask because in the options, my-hacks.php is called "legacy".
Well, that seems a bit old. I think a better bethod is to exclude a category from the front page by introducing the exclusion directly inside the loop of the theme's index.php
Th loop starts something like this:
<?php if (have_posts()) : while (have_posts()) : the_post(); ?>
To exclude category 4 from the front page, add this
condition :
<?php if ( !(in_category('4')) || !is_home() ) { ?>
<!-- Output the post here -->
<?php }>
This means that if on the front page, the post will be presented if it's not in category 4. On pages other than the front ( home ) page, all posts are presented.
Thanks, I will try that out. I knew that the my-hacks.php thing was old, but haven't seen anything else which was comparable.
chigh, did that work for you? I am looking to do the same thing.
Thanks for all the info. I haven't actually implemented this yet. I've been quite busy.
This topic has been closed to new replies.