Custom Avatars In Any WordPress Theme

The unique code in this download folder enables you to change the user profile picture for their avatar if desired, otherwise, a Gravatar is shown using their email address if it’s connected to a valid Gravatar account.

This code is not theme specific and works in any WordPress themes functions file, preferably in your child themes functions file.

Note : This code enables you to use a custom avatar globally meaning all instances of your default avatar including comments, author box and archives etc will be changed when you add your custom avatar.

Demo Video

Shows the custom image added on the User Profile edit page replacing all instances of your default Gravatar.

Tested using the Twenty Twenty default theme for WordPress, Divi by Elegant Themes & the Genesis Sample child theme by StudioPress.

Installation Steps

There’s 2 steps :

  1. # Copy & paste the PHP code ( without the opening PHP tag ) to the end of your child themes functions file.
  2.  

  3. # Install the ( ACF ) Advanced Custom Fields plugin ( free or premium version ). In your WordPress Dashboard, go to Custom Fields > Tools and import the acf-108181.json file which enables you to add custom avatars on the Edit User profile admin page for each user or author as seen in the demo video and first screenshot in this post.
  4.  

Download Folder

Related Tutorials

Join 5000+ Followers

Get The Latest Free & Premium Tutorials Delivered The Second They’re Published.