Custom Post Type Pagination On Front Page
-
Hello. I have a static front page called “Home”. This page uses a page template called “Front Page” (page-home.php). In the template I’m doing a custom query to pull a custom post types called “Gallery”. I’m trying to use WP PageNavi to paginate through these gallery items. And it’s not working. It shows page 1 fine, but when you click on page 2 it just looks like page 1 again. Here’s my code:
$loop = new WP_Query( array( 'post_type' => 'galactic_gallery', 'paged' => get_query_var( 'paged' ), 'posts_per_page' => 1 ) ); while ( $loop->have_posts() ) : $loop->the_post(); // output endwhile; wp_pagenavi( array( 'query' => $loop ) ); wp_reset_postdata();
I also have a page template called “Gallery” that I use to show the same custom post types, but that page paginates just fine with the above code. It’s something special going on with the query on the home page it seems, but I’m not sure.
Any help would be appreciated. Thanks!
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘Custom Post Type Pagination On Front Page’ is closed to new replies.