Hi Good friends,
I have an index page for my blog that pulls up all posts to the page. I have a group of posts i have assigned to a category named 'Diary'. I want to prevent posts in the 'Diary' category from showing up on the index(home) page.
The code in the index page that pulls up all posts is as follows
<?php if(have_posts()) : ?><?php while(have_posts()) : the_post(); ?>
<div <?php post_class(); ?>>
<span class="postlabel"><a href="<?php the_permalink() ?>"><span><?php the_time('d'); ?></span><?php the_time('M'); ?></a></span>
<h2 class="post-title"><a href="<?php the_permalink() ?>"><?php the_title(); ?></a></h2>
<p class="info">
<span class="catinfo"><?php _e('Filed in ', 'Mflat');?><?php the_category(' | ') ?></span>
<span class="cmtinfo"><?php comments_popup_link( __( 'Leave a comment', 'Mflat' ), __( '1 Comment', 'Mflat' ), __( '% Comments', 'Mflat' ) ); ?><?php edit_post_link(' Edit', ' | ', ''); ?></span>
</p>
<div class="entry">
<?php $Mflat_options = get_option('Mflat_theme_options'); ?>
<?php if ( $Mflat_options['home_excerpt_check']== 1 ) { the_excerpt(__('» Read more','Mflat')); } else {the_content(__('Continue Reading','Mflat'));} ?>
</div>
<?php wp_link_pages(array('before' => '<p><strong>Pages:</strong> ', 'after' => '</p>', 'next_or_number' => 'number')); ?>
<p class="infobottom">
<?php if(function_exists('the_views')): ?><span class="count"><?php the_views(); ?></span><?php endif; ?>
<?php if (has_tag()): ?><span class="tags"><?php the_tags(' '); ?></span><?php endif; ?>
</p>
</div>
<?php endwhile; ?>
<div class="flip">
<div class="prevpost"><?php next_posts_link(__('Older Entries', 'Mflat')) ?></div>
<div class="nextpost"><?php previous_posts_link(__('Newer Entries', 'Mflat')) ?></div>
</div>
<?php else : ?>
<div id="main">
<h2><?php _e('Not Found', 'Mflat'); ?></h2>
</div>
<?php endif; ?>
now i want to alter this code so that every other post is displayed EXCEPT the post belonging to the 'Diary' Category.
All contributions are warmly welcome.
Thanks