DZone Snippets is a public source code repository. Easily build up your personal collection of code snippets, categorize them with tags / keywords, and share them with the world

Snippets has posted 5883 posts at DZone. View Full User Profile

Pagination For Multiple Loops Page

  • submit to reddit
        // Pagination for multiple loops page

<h3>Recent Articles</h3>
$temp = $wp_query;
$wp_query= null;
$wp_query = new WP_Query();
<?php while ($wp_query->have_posts()) : $wp_query->the_post(); ?>
	<li><a href="<?php the_permalink() ?>" rel="bookmark"><?php the_title(); ?></a></li>
<?php endwhile; ?>
<div class="navigation">
  <div class="alignleft"><?php previous_posts_link('« Previous') ?></div>
  <div class="alignright"><?php next_posts_link('More »') ?></div>
<?php $wp_query = null; $wp_query = $temp;?>