Excellent software and practical tutorials
My Gravatar profile picture is not accessible. How can I fix this?
The solution to the default Gravatar avatar is to get rid of mysterious people, blanks, Gravatar logos, abstract graphics, Wavatars, and little monsters!
Download in pluginWP User AvatarPlugins.
WP User Avatar
WordPress currently only allows you to useGravatarUpload a custom avatar.WP User AvatarEnables you to use any photo you've uploaded to your media library as an avatar. This means you use the same uploader and library as you do for your posts. No extra folders or image editing features required.
WP User AvatarIt also allows you to:
- Upload your own default avatar in the WP user avatar settings.
- If the user does not have a WP user avatar image, the user'sGravatarAvatar or default avatar.
- DisableGravatarAvatar, only use local avatars.
- Use the [avatar_upload] shortcode to add a standalone uploader to your homepage or widget. This uploader is only visible to logged in users.
- [avatar] Use the shortcode in your posts. These shortcodes work on any theme, whether it has avatar support or not.
- Allow contributors and subscribers to upload their own avatars.
- Limit upload file size and image dimensions for contributors and subscribers.
Advanced Settings
For more information and documentation, visitWP User Avatar.
Add WP User Avatar to your own profile edit page
You can add a standalone uploader to any page using the [avatar_upload] shortcode. It is best to use this uploader alone without using other profile fields.
If you are building your own profile edit page with additional fields, the WP User Avatar is automatically added toshow_user_profileandedit_user_profileIf you wish to include the WP User Avatar in your own partial, you can add another hook:
do_action('edit_user_avatar', $current_user);
Then, to add WP User Avatar to that hook and remove it from other hooks outside of the admin panel, you can add this code to your functions.php theme file:
function my_avatar_filter() {
// Remove from show_user_profile hook
remove_action('show_user_profile', array('wp_user_avatar', 'wpua_action_show_user_profile'));
remove_action('show_user_profile', array('wp_user_avatar', 'wpua_media_upload_scripts'));
//Remove the hook from edit_user_profile
remove_action('edit_user_profile', array('wp_user_avatar', 'wpua_action_show_user_profile'));
remove_action('edit_user_profile', array('wp_user_avatar', 'wpua_media_upload_scripts'));
//Add to edit_user_avatar hook
add_action('edit_user_avatar', array('wp_user_avatar', 'wpua_action_show_user_profile'));
add_action('edit_user_avatar', array('wp_user_avatar', 'wpua_media_upload_scripts'));
}
//Only load outside of admin panel
if (!is_admin()) {
add_action('init', 'my_avatar_filter');
}
HTML Wrapper
You can change the HTML wrapper of the WP user avatar section by using the functions wpua_before_avatar and wpua_after_avatar. By default, the avatar code is structured like this:
Avatar
Original Size
Thumbnail
To remove the div container and h3 title you can add the following filter in your functions.php file in your theme: function my_after_avatar() {
remove_action('wpua_before_avatar', 'wpua_do_before_avatar');
remove_action('wpua_after_avatar', 'wpua_do_after_avatar');
To add your own wrapper, you can create the following:
function my_before_avatar() {
echo '
}
add_action('wpua_before_avatar', 'my_before_avatar');
echo '
}
add_action('wpua_after_avatar', 'my_after_avatar');
This will output:
Original Size
Thumbnail
WP User Avatar plugin background management interface
After installing the WP User Avatar plugin, you can use the default user avatar or customize the user's default avatar. Get rid of the mysterious person, blank, Gravatar logo, abstract graphics, Wavatar, and little monsters!
If you want to keep the avatar function of wp in China, you can use the "Useso take over Google" plug-in and use the publicCDN accelerationServe.
Perfectly solves the problem of avatar not being able to be displayed.