this is even easier now w/ the featured image that started in WP 2.9
add_theme_support( 'post-thumbnails' );
//wrap thumbs in link to post
function my_post_image_html( $html, $post_id, $post_image_id ) {
$html = '<div class="thumbnail"><a href="' . get_permalink( $post_id ) . '" title="' . esc_attr( get_post_field( 'post_title', $post_id ) ) . '">' . $html . '</a></div>';
return $html;
}
add_filter( 'post_thumbnail_html', 'my_post_image_html', 10, 3 );
that wraps the thumbnails w/ the permalink... and to use it you just need to put the_post_thumbnail( 'thumbnail' ) into the excerpt
// excerpt read more links and wrap excerpt in p tag
function all_excerpts_get_more_link($post_excerpt) {
if ( has_post_thumbnail() ) {
$child_excerpt = the_post_thumbnail( 'thumbnail' ) . '<p>' . $post_excerpt . '</p>' . '<p class="readmore"><a href="'. get_permalink($post->ID) . '">' . 'Continue Reading »' . '</a></p>';
}
else {
$child_excerpt = '<p>' . $post_excerpt . '</p>' . '<p class="readmore"><a href="'. get_permalink($post->ID) . '">' . 'Continue Reading »' . '</a></p>';
}
return $child_excerpt;
}
add_filter('wp_trim_excerpt', 'all_excerpts_get_more_link');
my function does a couple other things, but hopefully you get the idea