When we print the post thumbnail it comes with the img tag. However what should i do if i want only the image source url?
Option 1
$post_thumbnail_id = get_post_thumbnail_id(); $post_thumbnail_url = wp_get_attachment_url( $post_thumbnail_id );
Option 2
$post_thumbnail_id = get_post_thumbnail_id(); $image_url = wp_get_attachment_image_src($post_thumbnail_id,'thumbnail-size', true); echo $image_url[0];