Advertisement
alchymyth

loops

Mar 29th, 2012
137
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. <?php $my_query = new WP_Query('category_name=technology&posts_per_page=1');
  2.   while ($my_query->have_posts()) : $my_query->the_post();
  3.   $do_not_duplicate = $post->ID; ?>
  4.  
  5.   <?php the_title(); ?>
  6.  
  7. <?php endwhile; ?>
  8.  
  9.  <br/>
  10.  
  11. <?php if (have_posts()) :  ?>
  12.   <?php query_posts( array( 'category__and' => array(62,2270), 'posts_per_page' => 1, 'post__not_in' => array($do_not_duplicate) ) ); while (have_posts()) : the_post(); ?>
  13.  
  14.    <?php the_title(); ?>
  15.    
  16.    <br/>
  17.  
  18. <?php endwhile; endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement