Skip to:
Content
Pages
Categories
Search
Top
Bottom

Reply To: Add a welcome message to admin bar instead of website name


Virtuali
Participant

@gunju2221

function add_welcome_message() {
global $current_user;
get_currentuserinfo();
$author = $current_user->display_name;
if ( is_user_logged_in() ) {
echo "
<li>Welcome <strong>" . $author . "</strong></li>

";
echo '
<li><a href="' . wp_logout_url( site_url() ) . '">' . __( 'Log Out', 'buddypress' ) . '</a></li>

';
} else {
echo "
<li>Welcome <strong>Guest</strong></li>

";
}
}
add_action( 'bp_adminbar_menus', 'add_welcome_message', 15 );

Add in the remove_action( ‘bp_adminbar_logo’, ‘bp_adminbar_logo’ ); if you wish.

Skip to toolbar