-
Hi Ahmed,
Thank you for asking.
yes, it is doable. Are you comfortable with the css? -
Please put this in your bp-custom.php
/** * Inject classes to body based on displayed user's member types. * * @param array $classes array of css classes. * * @return array */ function buddydev_add_membertype_to_body_class( $classes = array() ) { if ( ! bp_is_user() ) { return $classes; } $member_types = bp_get_member_type( bp_displayed_user_id(), false ); if ( ! $member_types ) { return $classes; } foreach ( $member_types as $member_type ) { $classes[] = 'member-type-' . $member_type; // member-type-student etc. } return $classes; } add_filter( 'bp_get_the_body_class', 'buddydev_add_membertype_to_body_class' );
Now the pages for displayed users will have the class “-member-type-student”(Last part is the actual name of the member type) applied to body.
You can do the color changes etc bade on that.
PS: I will be including it in next update of member types pro plugin too.
Hope that helps.
Regards
Brajesh -
Thank you.
On the directory page, BuddyPress already ads the class like “member-type-{$member_type_name}” e.g member-type-student etc to the list item class.
Viewing 8 posts - 1 through 8 (of 8 total)
The topic ‘ [Resolved] Display member type profile by color’ is closed to new replies.
This topic is: resolved