query_posts causes pages to screw up
-
This is my current loop. I might have left out a bit when copy and pasting. Anyways, it works 100% great and fine when I don’t have that block of query_posts there. However, when I add it, it excludes the posts from that category fine, but when I click next page, it doesn’t work- It still shows the homepage posts, but the link url saids it’s on page 2. I tried using in_category, but it only ignores the posts, thus it doesn’t not keep the 7 post count properly.
<?php if (is_home()) { query_posts('cat=-7'); } ?> <?php if (have_posts()) : while (have_posts()) : the_post(); ?> <div class="entry <?php if(is_home() && $post==$posts[0] && !is_paged()) echo ' firstpost';?>"> <h3 class="entrytitle" id="post-<?php the_ID(); ?>"> <a href="<?php the_permalink() ?>" rel="bookmark"> <?php the_title(); ?> </a> </h3> <div class="entrymeta"> <?php the_time('F dS, Y'); echo " | Category: ";the_category(',');?> </div> <div class="entrybody"> <?php the_content(__('Read more'));?> <?php comments_popup_link( 'No comments ','1 comment ','% comments ', 'comments-link ','Comments are off for this post '); edit_post_link(__('<strong>Edit</strong>'));?> </div> <!-- <?php trackback_rdf(); ?> --> </div> <?php comments_template(); // Get wp-comments.php template ?> <?php endwhile; else: ?> <p> <?php _e('Sorry, no posts matched your criteria.'); ?> </p> <?php endif; ?>
Viewing 14 replies - 1 through 14 (of 14 total)
Viewing 14 replies - 1 through 14 (of 14 total)
- The topic ‘query_posts causes pages to screw up’ is closed to new replies.