Posted By

ivorpad on 07/17/10


Tagged

wordpress pagination WPQuery


Versions (?)

Who likes this?

2 people have marked this snippet as a favorite

osirisinternet
srdjan


WordPress Paginated WP_Query


 / Published in: PHP
 

  1. <?php $temp = $wp_query;
  2. $wp_query= null;
  3. $wp_query = new WP_Query();
  4. $wp_query?>query('showposts=5&category_name=thecategoryname'.'&paged='.$paged);
  5. ?>
  6. <?php while ($wp_query?>have_posts()) : $wp_query->the_post(); ?>
  7. <?php the_content(); ?>
  8. <?php endwhile; ?>
  9.  
  10. <div class="navigation">
  11. <div class="alignleft"><?php previous_posts_link('&laquo; Previous') ?></div>
  12. <div class="alignright"><?php next_posts_link('More &raquo;') ?></div>
  13. </div>
  14. <?php $wp_query = null; $wp_query = $temp;?>

Report this snippet  

You need to login to post a comment.