Tagged: icons in members directory
Hi Henrik,
Can you please confirm me if the Kleo theme uses font awesome ? If yes, I can post you the complete code to show the icon.Thank you
BrajeshThey use fontello, but dev says no problem inserting <link rel=”stylesheet” href=”https://maxcdn.bootstrapcdn.com/font-awesome/4.5.0/css/font-awesome.min.css”> in header.
Well, It is a bad idea to use font awesome for just 2 icons.
Also, just confirming that that the member type names are “male” and “female” or please let me know the correct member type names(unique names).Thank you
BrajeshIt could be .png images for all i care 🙂
kleo_bp_profile_member_type_label
k/members/type/mand
/members/type/kvinder
so unique name for ladies are = kvinde
and unique names for men are = mand
Hi Henrik,
Here is an example with font awesome. Please feel free to modify it and adapt with your own iconset./** * Show Font awesome icon based on the member type */ function buddydev_show_member_type_in_directory() { $user_id = bp_get_member_user_id(); if ( ! $user_id ) { return ; } $member_type = bp_get_member_type( $user_id, true ); $output = ""; if ( $member_type == 'kvinde' ) { $output ='<i class="fa fa-venus" aria-hidden="true"></i>'; } elseif ( $member_type == 'mand' ) { $output = '<i class="fa fa-mars" aria-hidden="true"></i>'; } echo $output; } add_action( 'bp_directory_members_item', 'buddydev_show_member_type_in_directory' );
Please put the code in bp-custom.php.
Hope that helps.Regards
Brajeshyou are a superstar, thank you so much. now i just need to style it nice..
Thanks mate..
The topic ‘ [Resolved] Showing member profile type as icon in members directory’ is closed to new replies.