I have an idea of how to do this, but I don't seem to be using the code correctly.
I'm working on an writer site, and using gravityforms for registration, and have mapped the fields to load in to the BP extended profile.
We have options for our members to display their real 'Legal Name' and/or 'Pen Name' on their profiles. The BP field visibility allows the members to choose if they want those be displayed on their profile. That's Great!
We also have a field that asks which one they prefer to be addressed by on our website.
I want to only show their preferred name choice on the /members page. (and eventually everywhere)
This is what I have in members-loop.php in my child theme.
<div class="item"> <div class="item-title"> <a href="<?php bp_member_permalink(); ?>"> <?php $preferredName= (xprofile_get_field_data( 'Preferred Name', $user_id = 0 )); echo $preferredName; echo bp_member_profile_data("$preferredName"); ?></a> </div>
I'm not sure how I'm supposed to refer to the user_id inside the loop.
What am I doing wrong?