Is there a way o changing user’s avatar without plugins? Why there’s no “Avatar Upload” section in Users > Your Profile?
I can’t use a plugin. Am I blind or being forced to use Gravatar? ;/
Is there a way o changing user’s avatar without plugins? Why there’s no “Avatar Upload” section in Users > Your Profile?
I can’t use a plugin. Am I blind or being forced to use Gravatar? ;/
You must be logged in to post a comment.
Avatars are meant to be controlled by the user, not by you. So yes, in a way, you’re being forced to use the Gravatar service. But remember, it gives the user the ability to use the same avatar anywhere, and you can always restrict the display of a gravatar based on content ratings (G, PG, PG-13, R).
Gravatar is a hosted service, which is why there’s no “Upload Avatar” section in the profile.
You say you “can’t use a plugin,” but really that’s the only way you can add features. If you want to use something other than Gravatar, you’ll need to load a plug-in to support it. There are a few plug-ins that support local avatars:
Otherwise, I recommend you educate your users on what Gravatars are and how to use them.
If you are asking how to replace the default gravatar with one of your own, you can put this code in the functions.php (or better yet the custom-functions.php if your theme supports it).
Create an image file and upload it to the image directory for your site. The “My Custom Logo” is the label for the option in the Discussion section of your Dashboard. This way any user who doesn’t have a gravatar will get the logo of your site instead.
You need a little more code for the avatar_defaults hook to work than the Ray Mitchell answer, I found this code on the wordpress codex pages
and it worked fine thanks to the normalized user id passed on to the default avatar hook (this works either with a simple user id or email AND with the object user itself)
I know that on one project site, I was able to create a field on the user profile editor page for accepting an image path(uploaded through the media page if I recall right) that was able to be used for avatars. No plugins needed.
I noticed that it depends on which theme is activated. No option in Mantra theme for example, but there is an option in the buddypress default theme.
You can do it… You need to add the image to your media. Copy that media file URL and paste/link it to your custom user avatar url under edit user. SORTED!
Add your avatar.jpg file to your child themes images folder and the following code to your child themes functions file: