All you’ll need to customize is the path to your default image. Use the below example code in your theme’s functions.php file to replace Default Gravatar with Custom Image
1 2 3 4 5 6 7 8 9 | function custom_gravatar($avatar_defaults) { //Change to whatever path you like. $logo = get_bloginfo('template_directory') . '/images/icons/gravatar_logo.jpg'; $avatar_defaults[$logo] = get_bloginfo('name'); return $avatar_defaults; }//END FUNCTION add_filter( 'avatar_defaults', 'custom_gravatar' ); |
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.