Last active
November 10, 2016 19:19
-
-
Save joedajigalo/8b09e9955b102ce438bf to your computer and use it in GitHub Desktop.
Get Image URL from Image ID
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 | |
/* Get Image URL from Image ID | |
-------------------------------------------------- */ | |
$media_image_id = XXX; // Specify the Image ID | |
$media_image_attributes = wp_get_attachment_image_src( $media_image, 'medium' ); // Get 'medium' image URL | |
echo '<img src="'. $media_image_attributes[0] .'" width="'. $media_image_attribute[1] .'" height="'. $media_image_attribute[2] .'"> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment