How do I display the featured image from an image gallery using a reference in code? (example within)

UPDATED

First, let’s create a new image size. We could update one of the existing sites, but we’ll just add a new one for experience sake. Open up your functions.php file and add the following:

if ( function_exists( 'add_image_size' ) ) { 
    add_image_size( 'new-size', 500, 500, true ); // Cropped 
    add_image_size( 'another-size', 400, 600 ); // Not Cropped 
}

Now, when you upload a new image, a version will be saved (assuming that the original is large enough) at the size you set via add_image_size.

For the existing images, you’ll need to generate new thumbnails. Try the following plugin: AJAX Thumbnail Rebuild.

Ok, now let’s update our reference to the new size:

<?php echo get_the_post_thumbnail( $post->ID, 'new-size' ); ?>

And here’s how to get it full sized:

<?php echo get_the_post_thumbnail( $post->ID, 'full' ); ?>

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)