In Buddyboss I’d like for each user’s avatar to have a border color according to his member type. In this way it will be easier to tell in which category users are in. For example: pink rim around girls’ avatars, blue for boys, red for admins. Can anybody please set me in the right direction? Thanks in advance
Hello,
Thank you for posting. Please try the following code in your “bp-custom.php” file.
// modify BuddyPress avatar class with member type add_filter( 'bp_core_avatar_class', function ( $classes, $item_id, $object ) { if ( 'user' !== $object ) { return $classes; } $member_type = bp_get_member_type( $item_id ); if ( $member_type ) { $classes .= ' member-type-' . $member_type; } return $classes; }, 10, 3 );
It will add a member-type specific class with an avatar then you can apply CSS rules to it.
Note: Please refer to the following URL for more info on the bp-custom file
https://buddydev.com/docs/buddypress-guides/what-is-bp-custom-php/Regards
Ravi
Viewing 2 posts - 1 through 2 (of 2 total)
You must be logged in to reply to this topic.
This topic is: not resolved