{"id":1428405,"date":"2010-03-17T00:42:50","date_gmt":"2010-03-17T00:42:50","guid":{"rendered":"https:\/\/wordpress.org\/support\/topic\/multiple-loop-problem\/"},"modified":"2016-08-19T16:19:07","modified_gmt":"2016-08-19T16:19:07","slug":"multiple-loop-problem","status":"closed","type":"topic","link":"https:\/\/wordpress.org\/support\/topic\/multiple-loop-problem\/","title":{"rendered":"Multiple loop problem&#8230;"},"content":{"rendered":"<p>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.<br \/>\ninstead 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&#8230;Any skilled eye spotting anything strange in the first loop as presented below?:<\/p>\n<pre><code>&lt;div id=&quot;column_01&quot;&gt;\n&lt;?php query_posts(&#039;gdsr_sort=review&amp;sort_order=asc&amp;gdsr_multi=1&amp;showposts=5&amp;cat=3,5,6,9,31&#039;); ?&gt;\n\n&lt;?php $posts = get_posts(&#039;numberposts=5&amp;offset=0&#039;); foreach ($posts as $post) : start_wp(); ?&gt;\n&lt;?php static $count1 = 0; if ($count1 == &quot;5&quot;) { break; } else { ?&gt;\n&lt;?php\nif($post_image !== &#039;&#039;) {\n?&gt;\n&lt;h2&gt;&lt;a href=&quot;&lt;?php the_permalink() ?&gt;&quot;  rel=&quot;bookmark&quot; title=&quot;Permanent url to &lt;?php the_title(); ?&gt;&quot;&gt;&lt;?php the_title(); ?&gt;&lt;br \/&gt;\n&lt;img src=&quot;&lt;?php echo $post_image; ?&gt;&quot; alt=&quot;&lt;?php if($post_alt !== &#039;&#039;) echo $post_alt; else the_title(); ?&gt;&quot; style=&quot;width:250px;height:190px &quot; \/&gt;&lt;\/a&gt;&lt;\/h2&gt;\n&lt;?php }\nelse {\necho &#039;missing image&#039;;\n} \/\/ endelse\n?&gt;\n\n&lt;?php $count1++; } ?&gt;\n&lt;?php endforeach; ?&gt;\n&lt;\/div&gt;<\/code><\/pre>\n","protected":false},"template":"","class_list":["post-1428405","topic","type-topic","status-closed","hentry","topic-tag-post-query"],"jetpack_sharing_enabled":true,"_links":{"self":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1428405","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic"}],"about":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/types\/topic"}],"version-history":[{"count":0,"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/topic\/1428405\/revisions"}],"wp:attachment":[{"href":"https:\/\/wordpress.org\/support\/wp-json\/wp\/v2\/media?parent=1428405"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}