Pagination with wp_query and custom post type
-
OK, I have looked at multiple solutions for this and no matter what I try it does not work. I cannot get this template to paginate. This is my code:
<?php $page = (get_query_var('paged')) ? get_query_var('paged') : 1; $temp = $multiPage; $multiPage = null; $multiPage = new WP_Query( array( 'paged' => $paged, 'posts_per_page' => 3,'post_type' => 'publications' )); while ($multiPage->have_posts()) : $multiPage->the_post(); ?> <div class="post"> ....Do loop stuff </div> <?php endwhile; // end of the loop. ?> <div class="pagenav"> <div class="alignleft"><?php previous_posts_link('Previous') ?></div> <div class="alignright"><?php next_posts_link('Next') ?></div> </div> <?php $multiPage = null; $multiPage = $temp; ?>
I have dug through many existing tickets and offered solutions and no matter what I try I cannot get the links to show up. If anyone can help it would be much appreciated.
You can see the live version of this loop running here: https://thenewobjectivity.com/twaas/?page_id=87
As you can see, the links are not even generated. I’m not worried about resolution through permalinks at this time. I will cross that bridge when I come to it. I just want the links generated. Please help! I’ve been beating my head against this wall for hours.
Thanks,
Josh
- The topic ‘Pagination with wp_query and custom post type’ is closed to new replies.