How to add avatar and make it default in wordpress

Topics focus on Web Developments, Programming, Database, Digital Marketing Tutorials, Code Snippets, SEO, Social Media Marketing and Inspirational articles.

How to add avatar and make it default in wordpress

How to add avatar and make it default in wordpress

Here, I have explained how to add avatar and make it default in wordpress. It’s very simple to add in wordpress and it will add more chance of branding of website.

Please add below code to function.php file.

1
2
3
4
5
6
7
add_filter( 'avatar_defaults', 'newavatar' );
 
function newavatar ($avatar_defaults) {
	$myavatar = get_bloginfo('template_directory') . '/images/avataricon.gif';
	$avatar_defaults[$myavatar] = "NewAvatarName";
	return $avatar_defaults;
}

Pin It on Pinterest

Share This