Hi all,
I’m trying to display logged in user’s cover image in buddypress login widget.
I was able to do that by using the code below in buddypress/bp-core/classes/class-bp-core-login-widget.php, however, this generates a stream of cover images of all registered members.
I assume I’m doing something wrong, most likely everything.
Who would be able to help me? Man, it would be great.
<?php if (bp_has_members($args)) : ?>
<?php while (bp_members()) : bp_the_member();?>
<?php // Get the Cover Image
$member_cover_image_url = bp_attachments_get_attachment('url', array(
'object_dir' => 'members',
'item_id' => bp_get_member_user_id(),
));
?>
<img src="<?php echo $member_cover_image_url; ?>">
<?php endwhile; ?>
<?php endif; ?>