wordpress loop - style 1st post differently to the following (side loop get_posts())

admin

Administrator
Staff member
In my wordpress theme, I want to add in the footer a side loop to fetch the latest posts.
the first post of this loop displays thumb pix, title, and post preview..
the 5 following only displays the title/link.

Since I already use the regular
Code:
<?php if(have_posts()) : while(have_posts()) : the_post(); ?>
in the main div, I have to use a side loop based on get_posts()

this is what I want to get, but it's not working:

Code:
<?php query_posts('cat=6&showposts=5'); ?>
<?php $posts = get_posts('category=6&numberposts=5'); 
$count = count($posts);
foreach ($posts as $post) : start_wp(); ?>
    <?php if ($count < 2) : ?>

        /// code for the 1st post (thumb etc..)

    <?php else : ?>

           /// code for the 4 following post (links to posts only)          

    <?php endif; ?>
<?php endforeach; ?>

I know how to add count/condition for the regular wordpress loop but not with the get_posts() function.

Can you please help me achieving that ?

Thanks in advance ;)

<hr>

edit: the solution :

Ok I used the 'offset' argument to achieve that:

Code:
&lt;?php $posts = get_posts('numberposts=2&amp;offset=0'); 
foreach ($posts as $post) : start_wp(); ?&gt;

&lt;a href="&lt;?php the_permalink() ?&gt;" title="&lt;?php the_title(); ?&gt;" class="footernews-thumb"&gt;
&lt;?php if ( has_post_thumbnail()) : ?&gt;
&lt;?php the_post_thumbnail(thumbnail); ?&gt;
&lt;?php endif; ?&gt;
&lt;/a&gt;

&lt;h2 class="footernews-title"&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" title="&lt;?php the_title(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;
&lt;p class="footernews-preview"&gt;&lt;?php the_content_rss('', TRUE, '', 20); ?&gt;&lt;/p&gt;

&lt;?php endforeach; ?&gt;        

&lt;?php $posts = get_posts('numberposts=3&amp;offset=1'); 
foreach ($posts as $post) : start_wp(); ?&gt;                      
&lt;h2 class="footernews-title"&gt;&lt;a href="&lt;?php the_permalink() ?&gt;" title="&lt;?php the_title(); ?&gt;"&gt;&lt;?php the_title(); ?&gt;&lt;/a&gt;&lt;/h2&gt;                        
&lt;?php endforeach; ?&gt;

Since the "loop" is not really a loop, I decided to avoid counting occurrence.