Skip to content

Instantly share code, notes, and snippets.

What would you like to do?
WordPress - Pagination for custom posts types
$temp = $wp_query;
$wp_query = null;
$wp_query = new WP_Query();
while ($wp_query->have_posts()) : $wp_query->the_post();
<!-- LOOP: Usual Post Template Stuff Here-->
<?php endwhile; ?>
<?php previous_posts_link('&laquo; Newer') ?>
<?php next_posts_link('Older &raquo;') ?>
$wp_query = null;
$wp_query = $temp; // Reset
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment