WordPress Custom Post Type Loop with WP PageNavi

March 21st, 2014 by
Replace “custom_post_type_name” with your custom post type.
<?php $loop = new WP_Query( array( 'paged' => get_query_var('paged'), 'post_type' => 'custom_post_type_name', 'posts_per_page' => 9 ) );
while ( $loop->have_posts() ) : $loop->the_post();

/*The Loop*/

endwhile;
?>
Then Add WP PageNavi
<?php wp_pagenavi( array( 'query' => $loop ) ); ?>

Post a Comment

You must be logged in to post a comment.

Cached at: 2024-05-02 10:07:50am