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():


get_the_post_thumbnail($id); 
// 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

0 comments:

Post a Comment