Getting the field of a user based on uid or name I'm trying to display some custom user fields of an author, of a content type's nodes. The only fields in $node that relate to the author seem to be $node-&gt;name and $node-&gt;uid. I tried this in node.tpl:
global $user;
print render($user-&gt;field_foo);

and it makes the field show up in Krumo, but it comes up as

field_foo (NULL)

When I get more specific, using what's available to me in the user page, $field_foo['und'][0] in this case, I'm given something similar:

field_foo (Array, 1 element)
und (Array, 1 element)
0 (NULL)

I'm thinking I need to target the UID or name somehow, but I don't know how. What's described in the answer here sounds like what I want, but I'm not sure how to do what they're describing. It sounds like I should maybe be using a node_submit function. Something like this maybe?
function MYMODULE_node_submit($node) {
  if (isset($node-&gt;name)) {
    if ($account = user_load_by_name($node-&gt;name)) {
      $node-&gt;uid = $account-&gt;uid;
    }
    else {
      $node-&gt;uid = 0;
    }
  }

  $node-&gt;uid-&gt;field_foo;

  return $node;
}
I think if you need show more info of author of node, you can try this way.

STEP 1

in file template.php write hook_preprocess_node

function YOURTHEME_preprocess_node(&amp;$vars) {
  $node = $vars['node'];
  $user = user_load($node-&gt;uid);

  // if you want render field user
  $phone_render = field_view_field('user', $user, 'field_phone')
  $phone_html = drupal_render($phone_render);

  // if you want get value of filed
  $phone = field_get_items('user', $user, 'field_phone');
  $phone_value = $phone[0]['value']; 

  $vars['phone_value'] = $phone_value;
  $vars['phone_html'] = $phone_html;
}


use need change field_phone with your machine name of your field user.

STEP 2
In file node.tpl.php. You can use 

&lt;?php
  print $phone_value;
  print $phone_html;
?&gt;


print where you need.