How to print the raw value of a custom user field in comments I want to print a custom user field of the commenters. It is an Link field (https://www.drupal.org/project/link). Some users have that field completed and other not.

I've read a lot of posts  related to this and tried several solutions. The only code that seems to nearly work OK is the following (found in https://drupal.stackexchange.com/a/129222):

&lt;?php print render(field_view_field('user',user_load($comment-&gt;uid), 'YOUR-CUSTOM-USER-FIELD'));?&gt;


The field shows, but there are 2 problems:

1) It causes 2 errors of "Strict warning: Only variables should be passed by reference en include() (line 73 of .../templates/comment.tpl.php)."

2) It shows the entire field, including its label and the complete link with the settings of the field. I only want the "raw" value of the field, the text that users introduce in the field.

Thanks for your help!
You can use the field_get_items() to get all values for this field, after use field_view_value().
Example below:

// user_uid_optional_load() will load the user object with all custom fields

$account = user_uid_optional_load($comment->uid);

$items = field_get_items('user', $account, 'field_name');

// as a example I'm using the number 0 as delta
$value = render(field_view_value('user', $account, 'field_name', $items[0]));