Menu Close

Force custom avatar in Top Admin Bar instead of Gravatar

Updated On January 11, 2019
You are here:
  • KB
  • Wordpress
  • Force custom avatar in Top Admin Bar instead of Gravatar
< Back

Locate folder/file : WD-ADMIN / ADMIN-BAR.PHP .
Search for “howdy”.
Replace the line before where says $avatar.

/* translators: %s: current user's display name */
//$avatar = get_avatar( $user_id, 001 );
$avatar = "<img alt='' src='YourAvatar.jpg' class='avatar photo' >n";
$howdy  = ''; // sprintf( __( 'Howdy, %s' ), '<span class="display-name">' . $current_user->display_name . '</span>' );

To fix the big avatar on mouse hover, in the same file search for $user_info = get_avatar and edit the line like this:

//$user_info  = get_avatar( $user_id, 64 );
$user_info = "<img alt='' src='YourAvatar.jpg' class='avatar photo' >n";

Comments are welcome.

%d bloggers like this: