Skip to content

Instantly share code, notes, and snippets.

@michaelmusgrove
Created January 18, 2016 02:00
Show Gist options
  • Save michaelmusgrove/f7615cab04ac70d7ab17 to your computer and use it in GitHub Desktop.
Save michaelmusgrove/f7615cab04ac70d7ab17 to your computer and use it in GitHub Desktop.
Replace Gravatar in WP

Building a function that will place one of 5 different avatars in the comments section.

add_filter( ‘avatar_defaults’, ‘newgravatar’ );
function newgravatar ($avatar_defaults) {
$myavatar = get_bloginfo(‘template_directory’) . ‘/images/gravataricon.gif’,‘/images/gravataricon.gif1’,‘/images/gravataricon.gif2’,‘/images/gravataricon.gif3’,‘/images/gravataricon.gif4’;
$avatar_defaults[$myavatar] = "webdesignPOP";
return $avatar_defaults;
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment