I'm trying to add custom profile fields to the member profiles that show on the Group > Single template but bp_member_profile_data doesn't seem to return anything.

This works fine when added to the members-loop.php:

<?php if ( bp_get_member_profile_data( 'field=Profile:' ) ) : ?>
  <?php echo '<BR><span class=memberslabel>Profile:</span> '; ?>
  <?php bp_member_profile_data( 'field=Profile:' ); ?>
<?php endif; ?>

But when I add it to groups/single/members.php it doesn't return anything.

Is there something special I need to add to make this function work in members.php?


The solution offered below works to get the profile data showing in on the group members loop, but it's showing the data of the last member for all members, I tried adding

<?php $user_ID = get_current_user_id(); ?>

and I also tried

<?php echo xprofile_get_field_data( 'Profile:', $bp->displayed_user->id ); ?>

but no change, how would I pass the relevant user ID into that function?

Also, it seems the profile fields are only showing for logged in users.

1 Answer 1


Try the following function, which is the one i use:


$u_id is the user ID in case you are not in a members loop.

So in your case should be:

<?php if ( xprofile_get_field_data( 'Profile', $user_ID ) ) : ?>
  <?php echo '<BR><span class=memberslabel>Profile:</span> '; ?>
  <?php echo xprofile_get_field_data( 'Profile', $user_ID ); ?>
<?php endif; ?>

UPDATE : You will need to paste your whole code to be sure you are using this on the right place. But you could try something like:

<?php while ( bp_group_members() ) : bp_group_the_member(); ?>

                <a href="<?php bp_group_member_domain(); ?>">

                    <?php bp_group_member_avatar_thumb(); ?>


                <h5><?php bp_group_member_link(); ?></h5>
                <span class="activity"><?php bp_group_member_joined_since(); ?></span>

                <?php do_action( 'bp_group_members_list_item' ); ?>

                <?php if ( bp_is_active( 'friends' ) ) : ?>

                    <div class="action">

                        <?php bp_add_friend_button( bp_get_group_member_id(), bp_get_group_member_is_friend() ); ?>

                        <?php do_action( 'bp_group_members_list_item_action' ); ?>


                <?php endif; ?>
                          $user_ID = bp_get_group_member_id();
                          if ( xprofile_get_field_data( 'Profile', $user_ID ) ) : ?>
                          <?php echo '<BR><span class=memberslabel>Profile:</span> '; ?>
                               <?php echo xprofile_get_field_data( 'Profile', $user_ID ); ?>
                <?php endif; ?>

        <?php endwhile; ?>
  • Actually not quite perfectly, see my edit above.
    – maikunari
    Jul 11, 2013 at 0:01
  • i updated my question with bp_get_group_member_id()
    – chifliiiii
    Jul 11, 2013 at 11:43
  • Thanks very much chifliiiii I haven't had a chance to get back to this yet but I'll take a closer tomorrow and let you know how it works, and paste in my code if necessary.
    – maikunari
    Jul 12, 2013 at 3:01
  • You rock so much, thanks - it now really is working perfectly! Cheers!
    – maikunari
    Jul 12, 2013 at 21:59

Not the answer you're looking for? Browse other questions tagged or ask your own question.