Skip to content

Instantly share code, notes, and snippets.

@soulston
Created December 6, 2012 14:49
Show Gist options
  • Save soulston/4224963 to your computer and use it in GitHub Desktop.
Save soulston/4224963 to your computer and use it in GitHub Desktop.
field_get_items
<?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