title: Drupal: How to display part of an author's profile in a node
body: <p>I have been trying to do display a custom field I created in the manage fields section of user accounts for nodes in addition to the profile page. The problem I am having with this code is that it will display the first field it finds and display that for every user, not the field for that particular user.
  And ideas? I believe it's finding the first value in the array and not the value for the particular user in the array.</p>
  
  <p>Here is m setup so far:
  Added this to my template.php of my theme:</p>
  
  <pre><code>function mythemename_preprocess_node(&amp;$vars) {
  
  global $user;
    $user = user_load($user-&gt;uid); // Make sure the user object is fully loaded
    $team = field_get_items('user', $user, 'field_team');
    if ($team) {
      $vars['field_team'] = $team[0]['value'];
    }
  }
  </code></pre>
  
  <p>Then, added this to my node.tpl.php in order to display it on nodes.</p>
  
  <pre><code>if (isset($field_team) &amp;&amp; !empty($field_team)) :
    echo '$field_team.'&lt;/div&gt;';
  endif;
  </code></pre>
  
  <p><strong>UPDATE:</strong> 
  Found my own aswer here:
  <a href="http://drupal.org/node/1194506" rel="nofollow">http://drupal.org/node/1194506</a></p>
  
  <p>Code used: </p>
  
  <pre><code>&lt;?php
    $node_author = user_load($node-&gt;uid);
    print ($node_author-&gt;roles[3]);
    print ($node_author-&gt;field_biography['und'][0]['value']);
  ?&gt;
  </code></pre>