HI I'm using wordpress v3.03 and i'm wondering how do you get featured images for that publish during my theme

Presently I'm using

get_the_post_thumbnail( $post->ID, 'post-thumbnail')

also it labored fine with 1 images, however when i stored add new images the above mentioned code always retrieve the very first image i connected to the publish rather than the look i set as "featured"

any assistance will be appreciated

In you are theme functions.php file add

add_theme_support( 'post-thumbnails' );
add_theme_support( 'post-thumbnails', array( 'post' ) );

Then in wordpress-admin whenever you edit a publish you ought to have a featured image box where one can set 1 featured image . Then informed you should use the next functions :



Once you added publish-pictures theme support , you need to create the featured image while using "featured image" box around the right sidebar on wordpress-admin/publish.php page . It's right underneath the "publish tags" box . Then outdoors the loop you should use get_the_publish_thumbnail() function to retrive that image . Should you did not set any featured image for that publish it'll fetch the final image you placed for the reason that publish .

Yet another way to create the featured image could be ( once you added publish-thumbnail theme support ) , happens when you place a picture in to the publish you'll have a "set featured image" once you submitted ( around the modal that let us you choose image alignment ) . Then your image should show on the best sidebar "featured image" box .