How to add images to posts loop

Hi,

I would really appreciate if one of you experts can shed light on my novice problem. If so I will greatly appreciate kind help. I am trying to develop theme based on “Wicked WP Themes” book and find it difficult to figure how to post thumbnails to all posts on my home page. Here is my functions.php script:

// Add support for thumbnails
add_theme_support(‘post-thumbnails’);
set_post_thumbnail_size(640, 300, true);
add_image_size(‘homepage-thumbnail’, 450, 200, true);

// custom homepage loop
function wicked_indexloop() {
query_posts(“posts_per_page=7”);
$counter = 1;
if (have_posts()) : while (have_posts()) : the_post(); ?>
<div id=“post-<?php the_ID() ?>” class=“<?php thematic_post_class() ?>”>
<?php thematic_postheader();
if ($counter == 1 && has_post_thumbnail() && !is_paged()) {
the_post_thumbnail(‘homepage-thumbnail’);
} ?>
<div class=“entry-content”>
<?php the_excerpt(); ?>
<a href=“<?php the_permalink(); ?>” class=“more”><?php echo more_text() ?></a>
<?php $counter++; ?>
</div>
</div><!-- .post –>
<?php endwhile; else: ?>
<h2>Eek</h2>
<p>There are no posts to show!</p>
<?php endif;
wp_reset_query();
}

Thank you for reading.

Walt