Advertisement
Guest User

Multiple Loops

a guest
Oct 17th, 2011
96
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.44 KB | None | 0 0
  1. <?php
  2. global $query_string; // required
  3. $query_string_backup = $query_string;
  4. $posts = query_posts($query_string.'category_name=news&posts_per_page=3');?>
  5.  
  6. <?php while ( have_posts() ) : the_post(); ?> <?php endwhile; ?>
  7.  
  8. <!--Loop 2-->
  9. <?php wp_reset_query(); // reset the query ?>
  10. <?php
  11. $posts = query_posts($query_string_backup.'category_name=jobs&posts_per_page=3');?>
  12.  
  13. <?php while ( have_posts() ) : the_post(); ?> <?php endwhile; ?>
  14.  
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement