Exclude Cat on Main Page in 2.0
-
Hello,
Since the upgrade to 2.0, my if statement in the index.php is no longer functioning. The statement should only show posts that are not in category 4 on the home page. Here is the code. Thank you in advance for any help you can provide.
<?php get_header(); ?>
<?php if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
<?php if ( !(in_category(‘4’) && is_home()) ) { ?><div class=”post”>
<h2 class=”posttitle” id=”post-<?php the_ID(); ?>”>” rel=”bookmark” title=”<?php _e(‘Permanent link to’); ?> <?php the_title(); ?>”><?php the_title(); ?></h2><p class=”postmeta”>
<?php the_time(‘F j, Y’) ?> @ <?php the_time() ?>
· <?php _e(‘Filed under’); ?> <?php the_category(‘, ‘) ?>
<?php edit_post_link(__(‘Edit’), ‘ · ‘, ”); ?><div class=”postentry”>
<?php the_content(“Continue reading ” . the_title(”, ”, false)); ?>
“>Comment on this post</div>
<p class=”postfeedback”>
” rel=”bookmark” title=”<?php _e(‘Permanent link to’); ?> <?php the_title(); ?>” class=”permalink”><?php _e(‘Permalink’); ?>
<?php comments_popup_link(__(‘Comments’), __(‘Comments (1)’), __(‘Comments (%)’), ‘commentslink’, __(‘Comments off’)); ?><!–
<?php trackback_rdf(); ?>
–></div>
<?php } ?> <!– Close the if statement. –><?php endwhile; ?>
<?php posts_nav_link(‘ · ‘, __(‘Next entries »’), __(‘« Previous entries’)); ?>
<?php else : ?>
<h2><?php _e(‘Not Found’); ?></h2>
<?php _e(‘Sorry, but the page you requested cannot be found.’); ?>
<h3><?php _e(‘Search’); ?></h3>
<?php include (TEMPLATEPATH . ‘/searchform.php’); ?>
<?php endif; ?>
<?php get_sidebar(); ?>
<?php get_footer(); ?>
- The topic ‘Exclude Cat on Main Page in 2.0’ is closed to new replies.