Return to Snippet

Revision: 47339
at June 6, 2011 00:53 by alp


Initial Code
/**
 * Customize Default Gravatars
 * http://digwp.com/2010/04/wordpress-custom-functions-php-template-part-2/
 *
 **/
function myfunction_custom_gravatars($avatar_defaults) {

	// change the default gravatar
	$customGravatar1 = get_bloginfo('template_directory').'/images/gravatar-01.png';
	$avatar_defaults[$customGravatar1] = 'Default';

	// add a custom user gravatar
	$customGravatar2 = get_bloginfo('template_directory').'/images/gravatar-02.png';
	$avatar_defaults[$customGravatar2] = 'Custom Gravatar';

	// add another custom gravatar
	$customGravatar3 = get_bloginfo('template_directory').'/images/gravatar-03.png';
	$avatar_defaults[$customGravatar3] = 'Custom gravatar';

	return $avatar_defaults;
}
add_filter('avatar_defaults', 'myfunction_custom_gravatars');

Initial URL
http://digwp.com/2010/04/wordpress-custom-functions-php-template-part-2/

Initial Description

                                

Initial Title
Wordpress: Customize Default Gravatars

Initial Tags
wordpress

Initial Language
PHP