/ Published in: PHP
                    
                                        
Gives you the option to select a custom gravatar in the Wordpress discussion setting in admin dashboard
                
                            
                                Expand |
                                Embed | Plain Text
                            
                        
                        Copy this code and paste it in your HTML
//place this in your functions.php file
<?php
add_filter('avatar_defaults', 'newgravatar'); function newgravatar ($avatar_defaults) {$myavatar = get_bloginfo('template_directory') . '/images/default_gravatar.png'; $avatar_defaults[$myavatar] = "yournamehere"; return $avatar_defaults;}
?>
//add this where you want your gravatar, notice the default url "<pathtourl>" removed
<?php echo get_avatar($comment,$size='48',$default='' ); ?></div>
Comments
 Subscribe to comments
                    Subscribe to comments
                
                