Page Navi doesn’t work properly

I’m trying to make page navigation for my project. I installed a plugin wp_pagenavi. It appears but when i click on 2 page, url changes number(page/2) but posts stay the same. Here is my code:

<?php if ( have_posts() ) : query_posts( array( 'cat' => 20','status'=>'publish'  ));
while (have_posts()) : the_post(); ?>
              <div class="media post">
             <div class="media-img"><?php the_post_thumbnail(array(360,230)); ?>
                  <div class="post-data with-img">
                    <p class="day"><?php the_time('j') ?></p>
                    <p><?php the_time('m') ?>.<?php the_time('Y') ?></p>
                <div class="media-body">
                  <h4 class="heading"><?php the_title(); ?></h4>
                  <p><?php the_content(); ?></p>
                <a href="<?php the_permalink() ?>" class="button main">Learn more</a>
              <? endwhile; ?>
              <?php wp_pagenavi(); ?>
              <? endif; wp_reset_query();?>

Read more here: Page Navi doesn’t work properly

Leave a Reply

Your email address will not be published. Required fields are marked *