WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I have the following code:

Template Name: blog
  <?php get_header(); ?>
  <div id="blog">
    <div class="content">
      <?php query_posts('cat=-4,-11');?>
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
        <div class="post">
          <h2><a href="<?php the_permalink(); ?>"><?php the_title(); ?></a></h2>
          <span class="date"><?php the_time('F jS, Y'); ?></span>
          <div class="body">
            <?php the_content(''); ?>
          <span class="info">posted by: <?php the_author(); ?> in <?php the_category(', '); ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span>
      <?php endwhile; endif; ?>
      <?php posts_nav_link(' &#183; ', '&laquo; previous page  ', ' <br />next page &raquo; '); ?>
    <?php get_sidebar(); ?>     
  <?php get_footer(); ?>

The page navigation is only needed in this template.

share|improve this question
up vote 2 down vote accepted

You would need to account for pagination in your query.... something like:

<?php query_posts( array(  
      'cat' => '-4,-11', 
      'paged' => ( get_query_var('paged') ? get_query_var('paged') : 1 ), 


share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.