Skip to:

Show User Meta Field Below Display Name

  • Alex Stine



    I have a custom user meta field which is a staff label field. For people with “staff” capability, they can go to their profile in WP admin and enter some text for a label such as “Lead Developer, Writer, Support, etc. I would like to output this label on BBPress profile but cannot figure out how to do it. I am using the currently displayed profile ID. In the following file:

    I know it’s bad to hack core files, I will move to my themes folder once it’s working. This is the code I have currently.

    $member_id = bp_displayed_user_id();
    if ( user_can( $member_id, 'staff' ) ) {
    if ( get_the_author_meta( 'staff') ) {
    $x = ( get_the_author_meta( 'staff', $member_id ) == '' ) ? "Staff" : get_the_author_meta( 'staff', $member_id );
    echo '<div class="staff-label">';
    echo $x ;
    echo '</div>';
    } ?>

    This code is working fine in the comments area with different logic to grab the user ID, just not working for BuddyPress. Any suggestions?

    Thanks. 🙂

Viewing 1 replies (of 1 total)

  • Alex Stine


    Sorry about that, looks like I posted it in the wrong forum. Feel free to close or delete.Sorry LOL! LooksSorry

Viewing 1 replies (of 1 total)
  • You must be logged in to reply to this topic.
Skip to toolbar