Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have the following code:

<?php
/*
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(''); ?>
          </div>
          <span class="info">posted by: <?php the_author(); ?> in <?php the_category(', '); ?> | <?php comments_popup_link('No Comments', '1 Comment', '% Comments'); ?></span>
        </div>
      <?php endwhile; endif; ?>
      <?php posts_nav_link(' &#183; ', '&laquo; previous page  ', ' <br />next page &raquo; '); ?>
    </div>      
    <?php get_sidebar(); ?>     
  </div>
  <?php get_footer(); ?>

The page navigation is only needed in this template.

share|improve this question
add comment

1 Answer

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 ), 
 )); 
?>

http://www.rvoodoo.com/projects/wordpress/wordpress-tip-fixing-pagination-on-custom-queries-with-query_posts/

share|improve this answer
add comment

Your Answer

 
discard

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.