/ Published in: PHP

Expand |
Embed | Plain Text
Copy this code and paste it in your HTML
/** * 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');
URL: http://digwp.com/2010/04/wordpress-custom-functions-php-template-part-2/
Comments
