Calling featured image in wordpress, or thumbnail URL

Calling product thumbnail( featured image):

Inside loop call this function:

<?php the_post_thumbnail(); ?>

This will display the image itself.

Calling url only:


With thumbanil size:

the_post_thumbnail_url( ‘thumbnail’ );

with medium size

the_post_thumbnail_url( ‘medium’ );

With full size

the_post_thumbnail_url( ‘full’ );

Calling url inside a img tag:

<img src=”<?php the_post_thumbnail_url(); ?>” alt=”image” class=”img”/>