WordPress allows us to use custom avatars that we upload to Gravatar. The Gravatar images are assigned to our accounts and follow us from one website to another, helping identify the author whether it’s a blog post or comment. This creates a Globally Recognized Avatar, or Gravatar for short. What if you want to disable Gravatar author images and add your own?
It’s possible that a contributor won’t have a Gravatar. It’s also possible they have one and don’t want to use it for your website. Allowing users to add their own avatars is a great way to let them personalize their account for your website and to use an avatar other than the default if they don’t have a Gravatar.
The easiest way to allow users to replace their Gravatars just for your website is by using a plugin such as WP User Avatar. This is a free plugin that’s found in the WordPress depository. It has over 200,000 active installs and a rating of 4.5/5. In this article we’ll take a look at what the free edition can do and see a list of the features in the premium edition.
Note – I apologize to Nathan ahead of time for what I’m about to do to him in this article.
(Editor’s Note: No worries, Randy!)
WP User Avatar
WP User Avatar by flippercode allows you to use any photo that’s uploaded to your media library as an avatar. You can even replace the default avatar and allow contributors and subscribers to upload their own avatars. You have control of file sizes and image dimensions. File types include JPG, PNG, and GIF’s. Install from the plugin depository and activate as normal.
After activating, visit the settings (in the dashboard, go to Avatars, Settings) and make your adjustments. The settings allow you to add the avatar button to the WordPress Visual Editor (allowing you to easily insert shortcodes within the content), allow users to upload their own, disable Gravatar completely, set file size limits, and upload a default avatar.
File Size and Edit
Set the file size limit for contributors and subscribers from 0 to 8192KB (or 8MB) by using the slider or entering the number you want in the field. You can enter the width and height that you’d like the images to resize to on upload and choose to automatically crop the images to those dimensions.
Selecting Allow users to edit avatars adds an edit button to their profile page in the dashboard.
Here users can rotate, flip, scale, crop, add a caption, alternate text, and a description.
You can change the default avatar in both the WP User Avatar settings and in the Discussion settings in the dashboard. The change it, select WP User Avatar and click Choose Image. This opens the media library where you can select your image. This will display the complete resized image, so if it’s a large image you’ll see a tiny version of it as your avatar. You might need to crop the image so it looks as intended at this small size. Once you’ve selected the image, everyone that doesn’t have a custom avatar will automatically have this avatar.
Custom User Avatars
A new field is added to the user’s profile (in the dashboard, go to Users, Your Profile). Here you’ll see the current avatar along with a thumbnail. This is my original Gravatar, so the original size and thumbnail are the same. Select Choose Image and upload or choose a new avatar from the media library.
In the media library, upload or choose the image you want and click Select. This works the same as the standard WordPress media library.
You’ll see the avatar as its original size. To set it as your avatar select Update Profile.
The avatar is now set as that user’s avatar and you’ll now see the original, the cropped thumbnail, and buttons to remove the image or undo.
A button is added to the Visual Editor where you can upload or choose avatars to add to the content. The first tab (labeled Avatar) allows you to choose a user, the image size (five choices), alignment (left, center, or right), where it links to (the file, attachment page, or custom URL), and enter a caption.
It will be added to the content as a shortcode. You can place it anywhere you want within the content.
Here’s the avatar placed within the content, but under the text with a divider line that creates an author profile. It includes the caption that I added and the position I chose from the dropdown box.
The second tab is labeled Upload. This allows you to place the uploader on any page or post by pasting in the shortcode. In order to use the file upload feature it has to be enabled in the settings screen.
This adds an upload feature to the content where users can upload their own avatars.
Users who are not logged in will not see the upload feature.
Uploads are handled through the front end. A window opens, allowing you to choose the image to upload from your computer.
You can see all avatars that have been uploaded by users in the Library (to see the library go to Avatars, Library in the dashboard). Only the admin has access to the library. Here you can edit, delete, and view all of the avatars.
It also includes a widget so you can add the uploader to the sidebar, footer, or any widget area. To use it just drop the widget where you want it.
Here’s the uploader in the footer. The upload feature works exactly the same as the uploader within the content. Just like the shortcode, the uploader will not appear for users that are not logged in.
The premium edition adds several features to make the plugin easier to use and streamline the workflow. Many of the features were requests from users.
- Capture a portion of an image
- Upload from webcam
- Upload on Registration page
- Custom folders
- External storage
- BBPress support
- Buddypress support
Allowing users to personalize their avatar for your website gives them an extra level of customization and keeps them from having to use the same Gravatar on every website. WP User Avatar is a simple plugin that makes it easy for users to use their own custom avatar just for your website. The plugin also provides an easy way to change the generic avatar. It’s worth using the plugin for that feature alone.
I found WP User Avatar easy to use. It’s an easy plugin to recommend for anyone wanting to provide avatar customization for their users or even replace the default avatar.
We’d like to hear from you. Have you used WP User Avatar? Let us know about your experience in the comments.
Featured Image via edel / shutterstock.com
The post How to Disable Gravatar Author Images and Add Your Own appeared first on Elegant Themes Blog.
Powered by WPeMatico