Show all posts of all categories but excluding a category on custom blog page with pagination of my theme

Show all posts of all categories but excluding a category on custom blog page with pagination of my theme

<h3>Recent Posts</h3>
<?php 
$paged = (get_query_var('paged')) ? get_query_var('paged') : 1;
$temp = $wp_query; $wp_query= null;
$category_id = get_cat_ID('Tour');
$wp_query = new WP_Query(); $wp_query->query('showposts=6' . '&paged='.$paged);
while ($wp_query->have_posts()) : $wp_query->the_post(); if(in_category($category_id)){?><div class="blog" style="display:none;">
<time datetime="2013-01-01"><?php echo date("j"); ?>
<?php echo strtoupper(substr(date("F"),0,3)); ?></time>
<div class="extra_wrapper"><div class="text1 upp"><?php the_title(); ?></div>
<div class="links">Posted by <?php the_author_posts_link(); ?><a href="<?php comments_link(); ?>" class="comment"><?php $comments_count = wp_count_comments();echo $comments_count->approved . " Comments";
?></a>
</div></div>
<div class="clear"></div>
<?php if(has_post_thumbnail()) { ?><?php the_post_thumbnail('full', array('class' => 'img_inner fleft')); ?> <?php } ?><div class="extra_wrapper">
<?php the_excerpt(); ?><br><a href="<?php the_permalink(); ?>"class="btn">Details</a></div></div><?php } else { another stuff...}?> 

Read more here: Show all posts of all categories but excluding a category on custom blog page with pagination of my theme

Leave a Reply

Your email address will not be published. Required fields are marked *