/plugins/buddypress/bp-templates/bp-legacy/buddypress/members/members-loop.php
<div class="item">
<div class="item-title">
<a href="<?php bp_member_permalink(); ?>">
<?php bp_member_name(); ?></a>
<?php if ( bp_get_member_latest_update() ) : ?>
<span class="update"> <?php bp_member_latest_update(); ?></span>
<?php endif; ?>
</div>
///////////// <YOUR CODE HERE> <LIKE_GET_THAT_FIELD> /////////////
<?php
/**
* Fires inside the display of a directory member item.
*
* @since 1.1.0
*/
do_action( 'bp_directory_members_item' ); ?>
> i created customed fields for the inner-page of the user, but they don’t show in the members list page.
The details depend on how you created these “customed fields”. If they are xprofile fields, then the simplest way is to do this:
$user_id = bp_get_member_user_id();
$data = xprofile_get_field_data( 'Custom Field Name', $user_id );
if ( $data ) {
echo $data;
}
If you stored it in user meta, do something similar:
$data = get_user_meta( $user_id, 'custom_field_name', true );
Either way, bp_get_member_user_id()
is how you get the ID of the current user in the loop.