activate plugin WP-PageNavi

<?php $loop = new WP_Query(); ?>
<?php $loop->query(array('post_type' => $posttype , 'paged' => get_query_var('paged'))); ?>

'paged' => get_query_var('paged') is Important

content in while loop

<?php wp_pagenavi( array( 'query' => $loop ) );
wp_reset_query();?>

Advertisements