WordPress: Custom Loop w/ Pagination


/ Published in: PHP
Save to your folder(s)



Copy this code and paste it in your HTML
  1. <?php
  2. $temp = $wp_query;
  3. $wp_query= null;
  4. $wp_query = new WP_Query();
  5. $wp_query->query('category_name=blog&showposts=1'.'&paged='.$paged);
  6. while ($wp_query->have_posts()) :
  7. $wp_query->the_post();
  8. ?>
  9.  
  10. <!--THIS IS THE POST CONTENT-->
  11.  
  12. <?php
  13. endwhile;
  14. $wp_query = null;
  15. $wp_query = $temp;
  16. ?>

Report this snippet


Comments

RSS Icon Subscribe to comments

You need to login to post a comment.