Get post thumbnail in specific size

First, you have to add custom image size using add_image_size, so when you upload new image using media uploader it will create thumbnail of that size which you assign for image. in add_image_size $crop parameter If false, the image will be scaled (default), If true, image will be cropped to the specified dimensions using center positions. in your active theme’s functions.php for add custom image size.

if ( function_exists( 'add_image_size' ) ) { 
    add_image_size( 'images_posts', 160, 213, true ); //(cropped)
}

After that when you add new image it will create new size of thumbnail then you can use that Image size identifier parameter.

$image_data  = wp_get_attachment_image_src( get_post_thumbnail_id( get_the_id() ), 'images_posts' );
$image_src = $image_data[0];

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