Latest 3 posts from specific category

I would like to have 3 “services boxes” on the home page, but they can be whatever a client wants. The 3 boxes are dynamic, so a client can create a new post and choose the category “frontpage item” (category id = 5). Link

This is my code:

<div id="services">

	<?php
		global $post;
		$args = array( 'numberposts' => 3, 'offset'=> 1, 'category' => 5 );
		$myposts = get_posts( $args );
		foreach( $myposts as $post ) :	setup_postdata($post); ?>

			<div class="services-box">

				<h4><?php the_title(); ?></h4>

                		<?php the_post_thumbnail(); ?>

                		<?php the_content(); ?>

            		</div>

         <?php endforeach; ?>

</div><!--end services-->

So ‘numberposts’ is 3, but only 2 posts show up. I checked the latest post and it has the right category assigned to it. I would like to set ‘offset’ to 3, but then none show up. Any help is appreciated.

Have you tried this? WordPress › Category Posts Widget « WordPress Plugins

Sam concept but less code.

I have that plugin, but i would like to hardcode this into my theme.
I use this plugin already in my theme for the sidebars.

But I solved the puzzle. I used this code:

<div id="services">
       
       <?php query_posts('category_name=voorpagina-item&showposts=3'); ?>
            
            <?php while (have_posts()) : the_post(); ?>
                
                <div class="services-box">
                    
                    <h4><?php the_title(); ?></h4>
                    
                    <?php the_post_thumbnail(); ?>
                    
                    <?php the_content(); ?>
                
                </div>
            
            <?php endwhile;?>
        
  </div><!--end services-->