Call User Profile Field in Node Template I have a field in my user profile of byline (field_byline). I'd like to call this in the node template so that the byline is included next to the author's name (e.g. Posted by Mr. Rogers | Sweater Entrepreneur) I kind of have it working, but not quite there yet. I'm using Drupal 7.10

Right now, I have this in my template.php

global $user;
  $user = user_load($user-&gt;uid);
  $bylines = field_get_items('user', $user, 'field_byline');
  if ($bylines) {
    $vars['field_byline'] = $bylines[0]['value'];
  }

}


And this in my node.tpl.php

if (isset($field_byline) &amp;&amp; !empty($field_byline)) :
  echo '&lt;span class="byline"&gt;| ' . $field_byline.'&lt;/span&gt;';
endif;


But, my problem is this only calls the correct byline while viewing the individual node. It breaks on the front page when all the nodes are looped out and only displays the byline of the first user, not the one that wrote the post.

Any help or direction would be much appreciated!
global $user is that of the currently logged in user, not specifically the owner of any specific content.

So what your code was doing was just looping through printing your byline, eg, admin, eg uid 1.  What you need to do is grab the uid from the specific user's content, user_load(THAT-UID) into a variable, and then use that to get the byline into vars[] in hook_preprocess_node() so it goes to the specific node in question, not the page it is printed on.

(in D6 at least, still learning D7 but I am sure it's pretty similar)

Addition/Edit:  In D6, you can get the uid of the node author like this:

function hook_preprocess_node(&amp;$vars) {

  $node=$vars['node'];
  $uid=$node-&gt;uid;

  $byline= "whatever you need to do to get it with $uid"

  $vars['byline']=$byline;

}


just change hook to your theme or module name and you should be on your way.  You can now use the byline variable in your node.tpl.php (barring any typos or brainfades of mine above :)