Created
December 6, 2012 14:49
-
-
Save soulston/4224963 to your computer and use it in GitHub Desktop.
field_get_items
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 | |
$node = node_load($nid); | |
if ($image = field_get_items('node', $node, 'field_biography_image')) { | |
// Check the author actually has an image. | |
$image = current($image); | |
$image_author = $image['uri']; | |
$image_alt = check_plain($image['alt']); | |
$image_title = check_plain($image['title']); | |
// Run the image through image styles. | |
$image_author = image_style_path('profile-small', $image_author); | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment