Multiple loop not working – displaying standard 10 posts
-
I have a 3-column layout. I am trying to achieve a setup where the entirety of the latest post displays in the left, widest column by itself. In the middle column, part of sidebar.php, the next 7 most recent post titles and excerpts, followed by 8 titles only.
I’m using the following code to achieve these three separate loops:
<?php query_posts('showposts=1'); ?> <?php $posts = get_posts('numberposts=5&offset=0'); foreach ($posts as $post) : start_wp(); ?> <?php static $count1 = 0; if ($count1 == "1") { break; } else { ?> <!-- SECOND LOOP: display post excerpts 2 thru 8 --> <?php query_posts('showposts=7'); ?> <?php $posts = get_posts('numberposts=5&offset=1'); foreach ($posts as $post) : start_wp(); ?> <?php static $count2 = 0; if ($count2 == "7") { break; } else { ?> <!-- // THIRD LOOP: display post titles 8 thru 15 --> <?php query_posts('showposts=8'); ?> <?php $posts = get_posts('numberposts=5&offset=8'); foreach ($posts as $post) : start_wp(); ?> <?php static $count3 = 0; if ($count3 == "8") { break; } else { ?>
The first loop is located in my index.php file, while the 2nd and 3rd are located in the sidebar.php.
What is broken? Why is the standard 10 entries displaying in the middle column instead
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Multiple loop not working – displaying standard 10 posts’ is closed to new replies.