Last active
May 30, 2017 15:07
-
-
Save mojowill/ee5de3007a0a217437bb44541c97a1cc to your computer and use it in GitHub Desktop.
Custom WordPress Default Avatar
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?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