Guest User

Fix infinite loop?

a guest
Mar 28th, 2012
146
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.60 KB | None | 0 0
  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()) : while (have_posts()) : the_post();
  12.  if( $post->ID == $do_not_duplicate ) continue; ?>
  13.   <?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(); ?>
  14.  
  15.    <?php the_title(); ?>
  16.    
  17.    <br/>
  18.  
  19.   <?php endwhile; ?>
  20. <?php endwhile; endif; ?>
Advertisement
Add Comment
Please, Sign In to add comment