Hi, I've looked online and found a way to add default avatar into wordpress. I've followed what was described and have been trying for a while now, but nothing seems to work, so I'm asking for a little help.
For info, I'm using the catch-box theme.
So here's what I did :
1) created a 96x96 pixels jpg file
2) saved the image in 'wp-content/themes/catch-box/images'
3) opened functions.php (in catch-box folder)
4) pasted the code I found, somewhere in the file :
add_filter( 'avatar_defaults', 'newgravatar' );
function newgravatar ($avatar_defaults) {
$myavatar = get_bloginfo('template_directory') . '/images/my_image.jpg';
$avatar_defaults[$myavatar] = "My Image";
return $avatar_defaults;
}
And nothing ! It didn't work.
----
I also tried the "get_stylesheet_directory_uri() " instead of get_bloginfo.
I put the php tag (or I don't know what it's called) before and after.
Also tried without...
And still nothing.
<?php
THE CODE
?>
So, my questions are:
1) Is the code correct? What else could I try?
2) Where exactly in functions.php should I save these lines of code
(without messing things up ; ))
3) If I repeat this code, could I add a 2nd new default avatar?
4) My blank avatar in settings is now showing a "question mark" in a blue square (?) / Before it was a "white square"..
Why is that? And could it be the origin of my other problem?
THANK YOU very very much for your help..
I'm usually very motivated to find things on my own.. and I eventually succeed ! But this time, I'm stuck.
Cheers,
Stephanie