WP-PageNavi plugin only showing posts on the first page

I’m building a custom theme and I can’t get pagination to work properly. It only loads the first 4 posts and shows 1 page, as if there weren’t anymore posts. Here’s my code:

<?php
global $post;
$paged = (get_query_var(‘paged’)) ? get_query_var(‘paged’) : 1;
$args = array( ‘posts_per_page’ => 4, ‘category’ => 1, ‘paged’ => $paged, ‘post_type’ => ‘post’ );
$postslist = new WP_Query( $args );
if ( $postslist->have_posts() ) :
while ( $postslist->have_posts() ) : $postslist->the_post(); ?>

Then the post stuff:

<?php
if ( has_post_thumbnail() ) {
the_post_thumbnail(array(120, auto));
}
the_title();
the_excerpt(); ?>

And the pagination would be:

<?php wp_pagenavi(); ?>

What am i doing wrong?

Read more here:: WP-PageNavi plugin only showing posts on the first page

Leave a Reply

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