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'm trying to get pagination to work, I get the nav tools to show, but when i click to move to the next page it loads the first page every time. Here's the code:

<?php $args = array(
                    'post_type' => 'page',
                    'orderby' => 'title',
                    'order' => 'ASC',
                    'posts_per_page' => 5,
                    'paged' => get_query_var('page'),
                    'post_parent' => $parent
                ); ?>
          <?php query_posts($args); ?>

          <?php if ( have_posts() ) : ?>
              <?php while ( have_posts() ) : the_post(); ?>
                  //get the desired custom field values 
              <?php endwhile; ?>
          <?php endif; ?>

        <!-- navigation goes here -->
        <div class="naviButs">
            <?php wp_pagenavi(); ?>

Please if anyone can assist? Or maybe knows workaround?
Thanks in advance!

share|improve this question
up vote 2 down vote accepted

Replace 'page' with 'paged':

'paged' => get_query_var('paged'),
share|improve this answer
Thank you! You are the man!!!! – user3814 Mar 9 '11 at 9:59

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.