I have a custom post type called
video. Would like to paginate its archive page, showing only 3 posts on each page.
There is also a custom loop on the archive page that outputs all the video posts (for a thumbnail gallery).
This is the
<?php while( have_posts() ) : the_post(); ?> MAIN LOOP... <?php endwhile; wp_reset_query(); ?> <?php next_posts_link(); previous_posts_link(); > <?php $custom_loop = new WP_Query( array('post_type' => 'video', 'posts_per_page' => '-1' ) ); <?php while ( $custom_loop->have_posts() ) : $custom_loop->the_post(); ?> CUSTOM LOOP... <?php endwhile; ?>
I've tried to set the
posts_per_page to 3 using
pre_get_posts (code here). The pagination would work perfectly, but the custom loop now outputs only 3 posts and not all the posts!
Anyone with a hard-coded/non-plugin solution? Have been googling to no avail... Any advice/help would be most appreciated!!!