Last active
December 30, 2015 12:09
-
-
Save guillermorangel/7827108 to your computer and use it in GitHub Desktop.
Get post thumbnail image src
https://css-tricks.com/snippets/wordpress/get-featured-image-url/
This file contains 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 | |
//wp_get_attachment_image_src( $attachment_id, $size, $icon ); | |
$featureimage = wp_get_attachment_image_src( get_post_thumbnail_id() ); | |
$featureimage_url = $featureimage[0]; | |
echo $featureimage_url; | |
// https://css-tricks.com/snippets/wordpress/get-featured-image-url/ | |
$thumb_id = get_post_thumbnail_id(); | |
$thumb_url_array = wp_get_attachment_image_src($thumb_id, 'thumbnail-size', true); | |
$thumb_url = $thumb_url_array[0]; | |
?> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment