I think you're overthinking the system. Unfortunately the nomenclature isn't helping. The Thumbnail here is the actual image when you use get_the_post_thumbnail_url().
as an example. Say today you uploaded an image called myimage.jpg.
That would go, if you're storing images by date into this directory:
/wp-content/uploads/2017/07/myimage.jpg.
Now when you call :
$featured_img_url = get_the_post_thumbnail_url('full'); //(or leave the parameter blank)
echo $featured_img_url;
you would get:
http://www.example.com/wp-content/uploads/2017/07/myimage.jpg
On the other hand if you used this code:
$featured_img_url = get_the_post_thumbnail_url('thumbnail'); //(or choose a different thumbnail size..medium...large...)
echo $featured_img_url;
it would return:
http://www.example.com/wp-content/uploads/2017/07/myimage30x30.jpg
the autogenerated image based on your thumbnail settings.
to avoid the naming confusion you could also try...
wp_get_attachment_image_url()
but this requires the actual attachment id, not post id, whether or not you're in the loop.
$imgid = 6; //need to get it dynamically
$imgurldesktop = wp_get_attachment_image_url( $imgid, '' ); //use default image size
$imgurlmobile = wp_get_attachment_image_url( $imgid, 'home-slide-img-mobile' ); //use custom set size
full
insizes
, the original is under the keyfile
in the data returned fromwp_get_attachment_metadata
. Regardless,wp_get_attachment_image_src($imageID, 'full')
is correct, and will return an array containing the URL.wp_get_attachment_image_url($imageID, 'full')
before posting. You are right, to my surprise. I'm not sure why I thought it was failing