• Resolved itsageek

    (@itsageek)


    Could anybody tell me why this is looping infinitely?

    <?php get_header(); ?>
    
    <div id="content">
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
      <div class="post" id="post-<?php the_ID(); ?>">
        <h2>
          <?php the_title(); ?>
        </h2>
        <small><?php the_time(__('M jS, Y','branfordmagazine')); ?> | <?php _e('By','branfordmagazine');?> <?php the_author_posts_link('namefl');?>
    	<?php edit_post_link('Edit', ' | ', ''); ?>
        </small>
        <div class="entry">
           <?php the_content("<p class=\"serif\">" . __('Read the rest of this page', 'branfordmagazine') ." &raquo;
    "); ?>
    
          <?php wp_link_pages("<strong>" . __('Pages', 'branfordmagazine') . ":</strong>", '
    ', __('number','branfordmagazine')); ?>
        </div>
    
      <?php comments_template(); ?>
    
      <?php endwhile; else: ?>
      <?php endif; ?>
    
      <?php if (have_posts()) : while (have_posts()) : the_post(); ?>
    	  <?php $taglist = get_the_tags(); ?>
    	  <?php $tagcount = 0;?>
    	  <?php foreach($taglist as $taglists){
    		if ($tagcount == 0){
    			$myposts0 = query_posts("tag=VAMP&showposts=1");
    			$tagcount++;
    		}
    		elseif ($tagcount == 1){
    			$myposts1 = query_posts("tag=DYMAX&showposts=1");
    			$tagcount++;
    		}
    		elseif ($tagcount == 2){
    			$myposts2 = query_posts("tag=DGA&showposts=1");
    			$tagcount++;
    		}
    		else{
    			break;
    		}
    	 };
    	  ?>
    
    	  <div id="lefttag">
    		<ul>
    		<?php foreach($myposts0 as $mpost0) { ?>
    			<li><a href="<?php echo get_permalink($mpost0->ID); ?>"> <?php echo $mpost0->post_title; ?></a></li>
    		<? } ?>
    		</ul>
    	  </div>
    
    	  <div id="middletag">
    		<ul>
    		<?php foreach($myposts1 as $mpost1) {?>
    			<li><a href="<?php echo get_permalink($mpost1->ID); ?>"> <?php echo $mpost1->post_title; ?></a></li>
    		<? } ?>
    		</ul>
    	  </div>
    
    	  <div id="righttag">
    		<ul>
    		<?php foreach($myposts2 as $mpost2) {?>
    			<li><a href="<?php echo get_permalink($mpost2->ID); ?>"> <?php echo $mpost2->post_title; ?></a></li>
    		<? } ?>
    		</ul>
    	  </div>
    
    	  <?php endwhile; else: ?>
    	  <?php endif; ?>
    
    </div>
    </div>
    <?php get_sidebar(); ?>
    <?php get_footer(); ?>

    it shows up as
    bullet – post
    bullet – post… infinitely

    If you’d like to check out the actual site it’s https://blog.tippingpointlabs.com/?p=688 but please click stop as soon as you can, it will continue to load.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Query_posts infinite loop?’ is closed to new replies.