Change Howdy Manually

Hey Peeps

Thought I share a little something with you guys.

I donno if it so but I think most us want to use the Custom Admin Text plugin to change the “Howdy” in the admin bar to something more customized, I know I wanted to but it failed.

So here is a little something to change the Howdy in what ever you want to (please note that is for educational use) It worked for me and should work for you.

What you do first is to go to your sites root folder or where ever your wordpress installation is, then got to /wp-content/plugins/

There you will see a list of your plugins. Now we are going to create a new plugin, so we need to make a new folder (you could name it ‘change-howdy’ or what ever you like as long you know its there)

In that new folder you then create a new file called change-howdy.php or what ever you like as long as it has the .php at the end.

In that new file, you add the following:

<?php

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,
),
) );

}
}
?>

Alternative you can change only the ‘Welcome’ in what ever you want to have in the admin bar.

Remember your when doing ‘s .Example:”What’s Up” .Other wise you will get an error.

After all this you can now go to your WordPress Plugins, look for the plugin that you just created and Activate it (WPMU users should go to their network admin plugins page and Network Activate it)

And then, when activated, you should see your new text, Viola!

If all fails, you could just tippex all out on your screen and close your Windows, lol :wink:

Just reply for any other questions, Enjoy peeps!

(Any other improvements are welcome)