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'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; ?>
        </div>

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

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

share|improve this question
add comment

1 Answer 1

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
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.