Change Howdy from user profiles
-
Hi All
Any pointers to change “Howdy” from the user profile (frontend) which is so informal to something like “Welcome”. I think the change has to be done in the functions.php file of the theme and I have tried that, but it gets it done only in the backend and not with the frontend non admin user profiles.
I googled around and in through this forum but nothing really helpful and recent came up.I tried adding this in functions.php in the theme, but worked only with the admin backend –
add_action( ‘admin_bar_menu’, ‘wp_admin_bar_my_custom_account_menu’, 11 );
function wp_admin_bar_my_custom_account_menu( $wp_admin_bar ) {
$user_id = get_current_user_id();
$current_user = wp_get_current_user();
$profile_url = get_edit_profile_url( $user_id );if ( 0 != $user_id ) {
/* Add the “My Account” menu */
$avatar = get_avatar( $user_id, 28 );
$howdy = sprintf( __(‘Welcome, %1$s’), $current_user->display_name );
$class = empty( $avatar ) ? ” : ‘with-avatar’;$wp_admin_bar->add_menu( array(
‘id’ => ‘my-account’,
‘parent’ => ‘top-secondary’,
‘title’ => $howdy . $avatar,
‘href’ => $profile_url,
‘meta’ => array(
‘class’ => $class,
),
) );}
}
- The topic ‘Change Howdy from user profiles’ is closed to new replies.