Skip to content

Instantly share code, notes, and snippets.

@jayshreehcl
Created June 10, 2013 02:23
Show Gist options
  • Save jayshreehcl/5746147 to your computer and use it in GitHub Desktop.
Save jayshreehcl/5746147 to your computer and use it in GitHub Desktop.
Code provided below helps you to customize default avatar in WordPress. This code is for all non genesis theme users. This means if you have bought any premium theme or have created your own or if you have download it for free for any source then use the snippet provided below. make sure to copy the code at the bottom of your theme's function.ph…
//**Add Custom Default Avatar In Wordpress To Other Common Themes**/
add_filter( 'avatar_defaults', 'blogvkp_custom_gravatar' );
function blogvkp_custom_gravatar ($avatar_defaults) {
$myavatar = get_bloginfo('template_directory') . '/images/custom-gravatar.jpg';
$avatar_defaults[$myavatar] = "Custom Gravatar";
return $avatar_defaults;
}
@jayshreehcl
Copy link
Author

For further instructions please kindly read more at Adding Custom Default Avatar In Wordpress

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment