I have custom post types called clients, need to display 5 clients per page with pagination. The page what i have is page-clients.php
I have used the wp_pagenavi plugin.
I get a perfect navigation list 1,2,3 etc etc but on clicking them takes me to page not found
My Code
$args = array(
'posts_per_page' => 5,
'post_type' => 'clients',
'paged' => get_query_var('page')
);
query_posts($args);
<?php while ( have_posts() ) : the_post(); ?>
.....
<?php endwhile; // end of the loop. ?>
<?php wp_pagenavi(); ?>
<?php wp_reset_query();?>
Heres the way you can do it without pagination plugin 🙂 using
WP_QUERY
instead ofquery_posts
Would you please try above code?