To get the featured image url

The default image sizes of WordPress are "thumbnail", "medium", "large" and "full" (the size of the image you uploaded). These image sizes can be configured in the WordPress Administration Media panel under Settings > Media. This is how you can use these default sizes with get_the_post_thumbnail():

// without parameter -> Thumbnail
get_the_post_thumbnail($id, 'thumbnail'); 
// Thumbnail
get_the_post_thumbnail($id, 'medium');
// Medium resolution
get_the_post_thumbnail($id, 'large');
// Large resolution
get_the_post_thumbnail($id, array(100,100) );
// Other resolutions


Post a Comment