Adding a new avatar image to the default wordpress avatar called mystery man was always a new bloggers problem, Follow our tutorial and choose avatar which is more suitable to your theme.
Open your theme’s functions.php file and add this new function.
add_filter( 'avatar_defaults', 'newgravatar' );
function newgravatar ($avatar_defaults) {
$myavatar = get_bloginfo('template_directory') . '/images/my-gravatar.jpg';
$avatar_defaults[$myavatar] = "My Avatar";
return $avatar_defaults;
}
We are done. Using the add_filter function we changed the avat_default function a little bit, with newgravatar function. We added our new avatar in default wordpress avatar list. Change my-gravatar.jpg with your own. This file must be located in /images/ folder of your theme.
Now in order to change your default avatar go to Settings>Discussion and choose your image.
Cheers, Joshu
Related Articles You Are Probably Interested In:
Exactly what i was searching for.
Also do you know can these be done automatically by any plugins ?
Do let me know ….
Hey !
Infact this is the simplest method, And plugins are there, they will only allow your memebrs to add local avatars at the time of posting. (as far as i know)
Do this and easly add more and more avatars !
Cheers, Josh
Exactly what i was searching for.
Also do you know can these be done automatically by any plugins ?
Do let me know ….
Hey !
Infact this is the simplest method, And plugins are there, they will only allow your memebrs to add local avatars at the time of posting. (as far as i know)
Do this and easly add more and more avatars !
Cheers, Josh
i did not quiet get this working on changing the mistery man avatar, could you help me a lil further josh, ?
-kevin
i did not quiet get this working on changing the mistery man avatar, could you help me a lil further josh, ?
-kevin
The webpage is actually full of outstanding detail and is actually really exciting to read.
Properly done.
The webpage is actually full of outstanding detail and is actually really exciting to read.
Properly done.
Out of all of the sites that I've been too, this is the only one that actually made sense, and got my site to show custom avatars without messing up the code x_x
THANK YOU!