Re: Display the Group’s Mini Avatar In Group Activity Stream Listings
The code you’re looking for is this:
`if ( !function_exists( ‘bp_dtheme_activity_secondary_avatars’ ) ) :
function bp_dtheme_activity_secondary_avatars( $action, $activity ) {
switch ( $activity->component ) {
case ‘groups’ :
case ‘friends’ :
// Only insert avatar if one exists
if ( $secondary_avatar = bp_get_activity_secondary_avatar() ) {
$reverse_content = strrev( $action );
$position = strpos( $reverse_content, ‘a<' );
$action = substr_replace( $action, $secondary_avatar, -$position – 2, 0 );
}
break;
}
return $action;
}
add_filter( ‘bp_get_activity_action_pre_meta’, ‘bp_dtheme_activity_secondary_avatars’, 10, 2 );
endif;`
Add to your theme’s functions.php.
*Sidenote: I’m working on my own “template pack” plugin, tentatively titled “BuddyPress Theme Unite!”, which will make it way easier for theme developers to add support for BuddyPress to their WP theme.