Skip to main content
added 66 characters in body
Source Link
Darvanen
  • 4.1k
  • 17
  • 41

You need to loadreference the current user before you attempt$author of the comment rather than the currently logged in $user. Luckily, $author comes as a parameter to render the fieldtpl file, try this?:

<?php
  global $user;
  print render(field_view_field('user', $user$author, 'field_avatar'));
?>

You need to load the current user before you attempt to render the field:

<?php
  global $user;
  print render(field_view_field('user', $user, 'field_avatar'));
?>

You need to reference the $author of the comment rather than the currently logged in $user. Luckily, $author comes as a parameter to the tpl file, try this?:

<?php
  print render(field_view_field('user', $author, 'field_avatar'));
?>
Source Link
Darvanen
  • 4.1k
  • 17
  • 41

You need to load the current user before you attempt to render the field:

<?php
  global $user;
  print render(field_view_field('user', $user, 'field_avatar'));
?>