Here is a quick and easy way to extract the URL source for the thumbnail [of the featured img] of your post.
Inside the Loop
<?php // Extracting the thumbnail source URL $img_id = get_post_thumbnail_id(); $img_url = wp_get_attachment_image_src($img_id); $img_url = $img_url[0]; ?>
Outside the Loop
<?php $img_id = get_post_thumbnail_id(35); // 35 being the ID of the Post $img_url = wp_get_attachment_image_src($img_id); $img_url = $img_url[0]; ?>
If you also needed to get the height and width of the thumbnail, you can use the follow lines of code:
$img_url = $img_url[1]; // Get the width $img_url = $img_url[2]; // Get the height
You can read more on the official codex about the wp_get_attachment_image_src function.
Questions, thoughts or comments, please let us know in the comments.



Jonathan Dingman is a passionate blogger who loves writing about WordPress news, reporting on events, theme releases, awesome plugins, and more. He started using WordPress in 2004 and ran the first WordCamp NYC in 2008.