I need to retrieve only the first 5 images for a wordpress post but I don't know how to do this. I need to use this on a custom blog to be used on my home page. Any tips?
You have to get a post's attachments:
$attachments = get_posts( array( 'post_type' => 'attachment', 'posts_per_page' => 5, 'post_parent' => $post_id, ) );