Advertisement
Guest User

3 Loop - Wordpress

a guest
Mar 1st, 2011
143
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.72 KB | None | 0 0
  1. <?php $my_query = new WP_Query('category_name=featured&posts_per_page=1');
  2.   while ($my_query->have_posts()) : $my_query->the_post();
  3.   $do_not_duplicate = $post->ID;?>
  4.  
  5.    <!--- Do Stuff --->
  6.  
  7.     <?php endwhile; ?>
  8.  
  9.     <?php if (have_posts()) : while (have_posts()) : the_post();
  10.   if( $post->ID == $do_not_duplicate ) continue; ?>
  11.  
  12.    <!--- Do Stuff --->
  13.  
  14.     <?php endwhile; ?>
  15.  
  16.    <?php $my_query = new WP_Query('category_name=resources&posts_per_page=1');
  17.   while ($my_query->have_posts()) : $my_query->the_post();
  18.   $do_not_duplicate = $post->ID;?>
  19.  
  20.    <!--- Do Stuff --->
  21.  
  22.        <?php endwhile; ?>
  23.  
  24. <?php include (TEMPLATEPATH . '/inc/nav.php' ); ?>
  25.  
  26.     <?php else : ?>
  27.  
  28.         <h2>Not Found</h2>
  29.  
  30.     <?php endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement