The new the_post_image functionality in WordPress version 2.9 has been enhanced.
New is the wp-settings.php line
// Load in support for template functions which the theme supports require_if_theme_supports( 'post-thumbnails', ABSPATH . WPINC . '/post-image-template.php' );
In functions.php it queries whether the theme supports post-thumbnail function:
if ( function_exists( 'add_theme_support' ) ) add_theme_support( 'post-thumbnails' );
If you look at the file wp-includes/post-image-template.php, there are 4 new features:
The theme itself can check within the loop, if the post has a Post-Thumbnail, and if so, then it can be output:
<?php if ( has_post_image() ) : ?> <a href="<?php the_permalink(); ?>"><?php the_post_image( array( 75, 75 ), array( 'class' => 'alignleft' ) ); ?></a> <?php endif; ?>
Those interested in more features and information should check the file in WordPress 2.9:
Especially the function:
It allows to adjust the output by using hooks.
get_the_post_image the function
wp_get_attachment_image get also used, what has been explained in detail in this post just a few days ago.