Skip to content

Instantly share code, notes, and snippets.

@mojowill
Last active May 30, 2017 15:07
Show Gist options
  • Save mojowill/ee5de3007a0a217437bb44541c97a1cc to your computer and use it in GitHub Desktop.
Save mojowill/ee5de3007a0a217437bb44541c97a1cc to your computer and use it in GitHub Desktop.
Custom WordPress Default Avatar
<?php
function custom_gravatar ( $avatar_defaults ) {
$mytavatar = get_theme_directory_uri . '/images/avatar.jpg'; // Make Sure you change this depending on your image name and location
$avatar_defaults[ $mytavatar ] = 'My Custom Gravatar'; // This is what is displayed in the Admin settings when Picking your Default Avatar
return $avatar_defaults;
}
add_filter( 'avatar_defaults', 'custom_gravatar' );
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment