Nico Pagel
asked 6 years ago

I really love your new design and just wanted to know which technique you use to create these coloured avatars with a simple letter of the name in it?

Do you use a plugin or would you share it?

It’s perfect!

1 Answers
BigHug
answered 6 years ago

Hi Nico, 
We made a hook into get_avatar filter of WordPress, replace the default avatar ,when user didn’t have gravatar, by a html div with first character of their display name inside this box then make it by a colorful style with a bit of css. You can use this code here as a reference: https://gist.github.com/bighug/84176129be47c780e78c
Regards

Nico Pagel
replied 6 years ago

Is there a possibilty to use this in a standard theme or create a new plugin out of this snippet? I am not really familiar with programming so I ask..

Adnan Rashid
replied 6 years ago

I would really like a plugin for this also – looks great

BigHug
replied 6 years ago

Please download the above file.
Then copy and paste it into your theme folder. And add the following line of code into your functions.php file:
include_once trailingslashit(get_template_directory()) . ‘dw_avatar.php’;

Adnan Rashid
replied 6 years ago

Appreciate the response. I tried to add in that code into the functions.php file and also uploaded the referenced php file.

It show it on the web page but does not replace the actual avatar which is strange.

Do you think its a theme thing? my website is http://www.itengineerjobs.co.uk im using a wordpress buddy theme.

thanks,

adnan

BigHug
replied 6 years ago

The feature only replaces avatar for accounts that don’t have Gravatar before, if they already have or once had, the feature will not work. Can you try with a fresh new account to see if it works?

Marthael .
replied 6 years ago

@BigHug “Whoops.
We seem to have missed the gist of that gist you were looking for.”

Yan
replied 6 years ago

@BigHug

is the gist still available? The link is no longer available..

Jack Dawson
replied 6 years ago

@BigHug re-add?

Powered by DW Question & Answer Pro