0

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!

2

Replace 'page' with 'paged':

'paged' => get_query_var('paged'),

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

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