try to add this to functions.php of your theme:
add_action( 'wp_before_admin_bar_render', 'personalize_adminbar_appearance' );
function personalize_adminbar_appearance() {
global $wp_admin_bar;
$current_user = wp_get_current_user();
$user_id = get_current_user_id();
$avatar = get_avatar( $user_id, 16 );
$wp_admin_bar->add_menu( array(
'id' => 'my-account',
'title' => 'Wwelcome ' . $current_user->display_name . $avatar )
);
}
That caused a server error and my site wouldn’t load once added.
As a different option, I use this in 3.5.2:
add_filter( 'gettext', 'change_howdy_text', 10, 2 );
function change_howdy_text( $translation, $original ) {
if( 'Howdy, %1$s' == $original )
$translation = 'Logged in as %1$s';
return $translation;
}
It’s still showing up as “Howdy” on the site.
Works fine for me; might be something else in your functions.php file.
Thanks @songdogtech.
Your solution worked a treat! 🙂
function replace_howdy( $wp_admin_bar ) {
$my_account=$wp_admin_bar->get_node('my-account');
$newtitle = str_replace( 'Howdy,', 'Welcome', $my_account->title );
$wp_admin_bar->add_node( array(
'id' => 'my-account',
'title' => $newtitle,
) );
}
add_filter( 'admin_bar_menu', 'replace_howdy',25 );
Unless I’m doing something wrong, these didn’t work for me. Again the last one gave me a “server error” after I added it to my functions.php