Created
August 6, 2013 03:21
-
-
Save jmcclellan/6161747 to your computer and use it in GitHub Desktop.
Wordpress: get the post thumbnail URL
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// Use this to retrieve the URL of the featured post thumbnail. | |
// You can change the 'thumbnail' part to any wordpress image size (eg full, medium, thumbnail, etc.). | |
$thumb_id = get_post_thumbnail_id(); | |
$thumb_url = wp_get_attachment_image_src($thumb_id,'thumbnail', true); | |
echo $thumb_url[0]; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment