Multiple loop problem…
-
I have three loops om my index page in order to list last 5 posts according to GD Star Rating popularity in each of them. The listings are just title and a custom field related image. They are supposed to appear in 3 distinct columns, post 0-5,post 6-10, post 11-15.
instead I get one huge one-column list looping in the endless and no break in the next column. And it is only the latest posts image used for all posts listed…Any skilled eye spotting anything strange in the first loop as presented below?:<div id="column_01"> <?php query_posts('gdsr_sort=review&sort_order=asc&gdsr_multi=1&showposts=5&cat=3,5,6,9,31'); ?> <?php $posts = get_posts('numberposts=5&offset=0'); foreach ($posts as $post) : start_wp(); ?> <?php static $count1 = 0; if ($count1 == "5") { break; } else { ?> <?php if($post_image !== '') { ?> <h2><a href="<?php the_permalink() ?>" rel="bookmark" title="Permanent url to <?php the_title(); ?>"><?php the_title(); ?><br /> <img src="<?php echo $post_image; ?>" alt="<?php if($post_alt !== '') echo $post_alt; else the_title(); ?>" style="width:250px;height:190px " /></a></h2> <?php } else { echo 'missing image'; } // endelse ?> <?php $count1++; } ?> <?php endforeach; ?> </div>
Viewing 4 replies - 1 through 4 (of 4 total)
Viewing 4 replies - 1 through 4 (of 4 total)
- The topic ‘Multiple loop problem…’ is closed to new replies.