features category image instructions category image Option to Add Your Own Custom Avatar

Posted on October 26, 2009 and last modified on October 31st, 2009.

By adding this little bit of code [below] to the functions.php file, this theme has the ability for you to change your own avatar within the WordPress Dashboard – Discussion section.

So, go open your functions.php file and make the two small changes which refer to ‘FreshlyPressed’ above. Upload your image to the correct directory and then go into Admin – Discussion and down the bottom of the page you will see your shiny new, customised avatar ready to use as the default.

// CHANGE THE DEFAULT AVATAR IN WordPress
// -----------------------------------------------------------------------------
add_filter( 'avatar_defaults', 'newgravatar' );

function newgravatar ($avatar_defaults) {
    $myavatar = get_bloginfo('template_directory') . '/img/freshlypressedgravatar.png';
    $avatar_defaults[$myavatar] = "FreshlyPressed";
    return $avatar_defaults;
}

your_own_gravatar

Related Posts:

Author’s Details in Every Post

About the author

James has added 29 posts to this site so far...

Founder and co-admin at FreshlyPressed, James also runs and maintains many, many other sites including JamesICT which is very much focussed on WordPress and all of its little idiosyncrasies. He now lives in Brighton, England with his fiancée and writes novels in his spare time. His latest work, 'Procrastination Expectancies' is due out later this year - or maybe the year after that! [more...]

Other posts by James

Trackbacks/Pingbacks

  1. [...] Add-Your-Own for Default Gravatar [...]

Leave a Reply

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>