I asked this question before but was unable to respond before it was deemed resolved. I want to display the profile type in the sidebar header.
This was the code given to me in the last question-
COPY CODE
add_action( 'bp_before_member_header_meta', 'kleo_bp_profile_member_type_label' );
function kleo_bp_profile_member_type_label() {
$member_type = bp_get_member_type( bp_displayed_user_id() );
if ( empty( $member_type ) ) {
return;
}
$member_type_object = bp_get_member_type_object( $member_type );
if($member_type_object){
$member_type_label = '<p class="kleo_bp_profile_member_type_label">' . esc_html( $member_type_object->labels['singular_name'] ) . '</p>';
echo apply_filters('kleo_bp_profile_member_type_label', $member_type_label);
}
}
Unfortunately this code doesn't work. How do I solve this issue?
Thank you