mattlawck of StudioPress
8/3/2018 - 4:03 PM

Custom Gravatar

Custom Gravatar

<?php
//* Do NOT include the opening php tag shown above. Copy the code shown below.

//* Create a custom Gravatar
add_filter( 'avatar_defaults', 'sp_custom_gravatar' );
function sp_custom_gravatar ($avatar) {
	$custom_avatar = get_stylesheet_directory_uri() . '/images/gravatar.png';
	$avatar[$custom_avatar] = "Custom Gravatar";
	return $avatar;
}