• !! Paling Glamour !!

  • !! Please LEAVE Your Visit Msg Here !!


    !! I'll Return Da Favour Later !!

  • Recent Comments

    You've put up some decent points in this po...
    smart2.. cuba nanti.. lain dari yg lain.....
    Great post! I am just starting out in commu...
    Wonderful to read!...
    I see, u are silent reader. by the way than...
    owh nice mate, but currently all my content...
    Nanti akan ada update terbaru pasal comment...
    Thanks mate.. your comment mostly appreciat...
    salam.. saya dah buat da tapi saya tak tah...
    Your website is almost certainly pushing is...
  • !! Wayang Gambar !!

Ichigo In Da House

@- Bukan Sekadar Blog -@

Get Rid of WordPress Default Gravatar

Gravatar is one of the best / great features for WordPress. It is nothing but the image associated to your email id. Whenever you use this email address for placing comments or create profiles in WP blog, the image associated to your email is displayed.

You can read more about Gravatar on WP because this tutorial is not about ‘what is gravatar?’ So in this tutorial I am going to show you how to change the default “Mystery Man Gravatar” to your very own “Custom Gravatar”.

You can use gravatar in wordpress with the gravatar wordpress plugin or it can be manually added in index.php, comments.php and comments-popup.php

Many times the gravatar comes with the WordPress Theme, so in this case it is located in the functions.php file. This file is responsible for additional options of the theme which appears in the WordPress Dashboard.  So let’s add the new gravatar.

Open functions.php file. Add the following code at the end of the file just before and save it.

/* Custom Gravatar */
add_filter( 'avatar_defaults', 'newgravatar' );
function newgravatar ($avatar_defaults) {
     $myavatar = get_bloginfo('template_directory') . '/images/custom-gravatar.jpg';
     $avatar_defaults[$myavatar] = "Custom";
     return $avatar_defaults;
}

Upload Image:

Using ftp software like filezilla, Login to your hosting and upload image of your choice to use as avatar in ./wp-content/theme/yourcurrenttheme/images/custom-gravatar.jpg. Remember to rename image as custom-gravatar.jpg before upload to your hosting

Explanation:

First line is adding a “newgravatar” to the default avatars (avatar_defaults) available in the WordPress.

add_filter( 'avatar_defaults', 'newgravatar' );

Next the newgravatar function is providing the location of the image which is in the images folder of the WP installation directory and assigning a name “Custom” to it.

function newgravatar ($avatar_defaults) {
     $myavatar = get_bloginfo('template_directory') . '/images/custom-gravatar.jpg';
     $avatar_defaults[$myavatar] = "Custom";

And finally the output is sent back to default avatars (avatar_default) which displays the gravatar in the default gravatar list in the dashboard.

return $avatar_defaults;

Now go to your Dashboard->Setting->Discussion. Scroll down the page and select your new default gravatar, then Save Changes. And you are done.

So from now on there will be no Mystery men in your blog. Anyone leave a comment in your blog if they didn’t register with gravatar their image will be replace with your new custom gravatar. If you are real blogger you must use gravatar and registered, gravatar is your personalities ok. p/s you can use your own image, just rename the image before upload. This is what Ichi used now, give it a try and ichi wish a good luck.

What do you think about the Mystery Man? Nice, Cool, or Not Cool at All. Do you want to keep the Default Gravatar or want your own Custom Gravatar? Please Let Ichi know in the Comment!




Related Articles

Categories: Tutorial
wrote :
wow,very nice in this entry,we can add custom gravatar ,it`s very² cool,thanks for sharing bro
wazy´s last blog ..Adobe Photoshop CS3 & CS4 Portable My ComLuv Profile

[Reply]

Ichigo


welcome bro wazy.. mentang2 la entri lan english komen pn nak english gak.. hik hik

[Reply]

wazy


Hehehe saja je bro,ikut syle ko gak la
wazy´s last blog ..Adobe Photoshop CS3 & CS4 Portable My ComLuv Profile

[Reply]

Ichigo


kadang2 tu kena gak guna english, ikut kesesuaian penerangan la

[Reply]

Comment on 5 March, 2010 at 09:06 pm
wrote :
bagus ni bro.. nanti taklah keluar monster gravatar tu..
kulanz´s last blog ..Saya Dah Buang Iklan Innity? My ComLuv Profile

[Reply]

Ichigo


haha tu la pasal, suka suki jer dia generate monster kan. ^_^

[Reply]

Comment on 6 March, 2010 at 12:07 am
wrote :
sajer try…huhu…best jgk..tapi biar jer la aku wavetar
Roslan´s last blog ..Blog Aku Do Follow, Blog Anda Bagaimana? My ComLuv Profile

[Reply]

Ichigo


hehe ok la tu.. mana tau lenkali nak ubah selera kan.

[Reply]

Comment on 7 March, 2010 at 05:11 pm
wrote :
Takdela keluar muka “monster” bila takde personal gravatar…

[Reply]

Ichigo


itula bro.. yg bagusnya, bleh la set icon kegemaran ataupn yg nmpk macho sket kan

[Reply]

Comment on 8 March, 2010 at 04:59 pm
wrote :
gud2… very2 gud… tq untuk informasi ni bro
mancai´s last blog ..google, kata benda yang akan menjadi kata kerja My ComLuv Profile

[Reply]

Ichigo


sama-sama bro…

[Reply]

Comment on 16 March, 2010 at 06:06 am
wrote :
Keluar muka sendiri baru mantap. Boleh promosi muka free..hehe
Azizi Zulkefli´s last blog ..E-Mel Pembaca My ComLuv Profile

[Reply]

Comment on 30 April, 2010 at 02:50 pm
wrote :
What a great site and informative posts. I will add a bookmark to this site. Best regards.

[Reply]

Comment on 17 May, 2010 at 12:49 pm
dwen
wrote :
mcm mana ey nak buat page mcm ni dalam fb?

[Reply]

Comment on 29 June, 2010 at 07:12 pm
wrote :
smart2..
cuba nanti..
lain dari yg lain…
syahrilhafiz´s last blog ..Backtrack Di GenggamankuMy ComLuv Profile

[Reply]

Comment on 2 September, 2010 at 12:21 am