User avatar in BuddyPress notification loop

BuddyPress by default doesn’t show user avatar in the notifications. But you can do that by simply adding couple of lines in notification loop.

BuddyPress stores the other user id as secondary id.

Here is the code to be used in notification loop.

echo bp_activity_avatar(
    array( 'user_id' => bp_get_the_notification_secondary_item_id() )
);

That’s it…

2 Comments