Exclude most recent post in 2nd loop
-
I have 2 loops on my index page. The first loop displays the most recent post.
<?php query_posts('posts_per_page=1'); ?>
<?php if (have_posts()) : ?>
<?php while (have_posts()) : the_post(); ?>
<!-- bla bla bla -->
<?php endwhile; ?>
<?php else : ?>
<?php endif; ?>
The second loop must show the other 5 recent posts/the posts except the one above from loop1.
This is the 2nd loop:<?php rewind_posts(); ?>
<?php
if ($posts) : foreach ($posts as $post) : start_wp();
?><?php if (get_posts('')) { ?>
<!-- bla bla bla -->
<?php } ?>
<?php endforeach; else: ?>
<?php endif; ?>
How do I alter my second loop so that the most recent post is excluded and only 5 posts are shown?
- The topic ‘Exclude most recent post in 2nd loop’ is closed to new replies.