Print profile2 fields in user-profile.tpl.php Been trying to print the profile2 fields in the user-profile.tpl.
The fields are of type: taxonomy reference field and link field. 

The documentation provided in drupal doesn't work.

Workarounds provided in the profile2 issue queue here and here either prints the current users value in every profile or renders it twice. 

It'll really great if someone can help me with this. Thanks for your time.

In user-profile.tpl the below renders the fields twice, once within the div and other without it from "print render($user_profile);"

    &lt;div class="athlete-info"&gt;
    &lt;?php $user_uid = $elements['#account']-&gt;uid;
    $profile = profile2_load_by_user($user_uid, 'athlete');

     print drupal_render(field_view_field('profile2', $profile, 'field_name', 'value'));
     print drupal_render(field_view_field('profile2', $profile, 'field_twitter','value'));
     print drupal_render(field_view_field('profile2', $profile, 'field_facebook', 'value'));
     print drupal_render(field_view_field('profile2', $profile, 'field_role', 'value'));
     ?&gt;
     &lt;/div&gt;


But this causes an error page on other user roles who don't have to fill up the athlete profile type. :(

EDIT: I am using the profile 2 module to create a profile called athlete with few extra fields like field_facebook,field_twitter and assign them to users of a particular role.
If these fields are already a part of $user_profile and what you are wanting to do is print them in another place/div on the page, you can do something like this:

&lt;?php
  hide($user_profile['field_name']);
  hide($user_profile['field_twitter']);
  hide($user_profile['field_facebook']);
  hide($user_profile['field_role']);
?&gt;
&lt;div class="profile"&lt;?php print $attributes; ?&gt;
  &lt;?php print render($user_profile); ?&gt;
&lt;/div&gt;
&lt;div class="athelete-info"&gt;
  &lt;?php print render($user_profile['field_name']); ?&gt;
  &lt;?php print render($user_profile['field_twitter']); ?&gt;
  &lt;?php print render($user_profile['field_facebook']); ?&gt;
  &lt;?php print render($user_profile['field_role']); ?&gt;
&lt;/div&gt;


Eg, hide() the fields you want to print elsewhere, then render() the rest of the profile and then finally render() those specific fields where you want them.

Now, if you are getting an error because these don't exist everywhere, you can do something like this:

&lt;?php if (isset($user_profile['field_facebook']): ?&gt;
  &lt;?php hide($user_profile['field_facebook']); ?&gt;
&lt;?php endif; ?&gt;


and a similar wrapping around the final printing (ADDITION: this appears to be unneeded as I didn't get any errors when I did a hide($user_profile['i_got_nothing_to_hide']); and a quick look at the code for hide and render shows that they pretty smart/sneaky about being passed undefined variables or keys)

Or you could check on the user role,  but if this is going to begin to put a lot of php logic into the template, you may want to investigate preprocessing() it and using a special template for the user profile of the users with this/these roles.