Guest User

Untitled

a guest
Oct 19th, 2017
69
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
PHP 0.48 KB | None | 0 0
  1. // Get the fields of the taxonomy term that this node is categorized under.
  2. $main_category_term_fields = field_fetch_field_values('node', $node, 'field_my_taxonomy_term');
  3.  
  4. // Acquire the path to the image field on the taxonomy term (field_category_image).
  5. $image_path = $main_category_term_fields[0]['taxonomy_term']->field_category_image['und'][0]['uri'];
  6.  
  7. // Use theme_image() to format the file path as a rendered image.
  8. $display_image = print theme_image(array('path'=>$image_path));
Add Comment
Please, Sign In to add comment