• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2784

Original Genesis Tutorials & 6000+ Guaranteed Code

Snippets

  • Consultation
  • Full Access
  • Log in

Custom Author Avatars For Any User

This code enables you to use a custom image in replace of a Gravatar hosted image for any author in any WordPress theme. You can add the images for each author in your child themes images folder.

Update : You’ll also find a 2nd solution which enables each user to upload a custom image which replaces the default avatar connected to their email address.

Here’s the demo video which shows Author 1 using a Gravatar hosted image and all other authors using a custom avatar.

Installation Instructions

There’s 3 simple steps:

Step 1 : Paste the PHP code below to the end of your child themes functions file.

Step 2 : Swap out the author id in the code to match the user id for each author. You can get each author id simply by hovering over the delete link on the Users > All Users admin page like you see in the following screenshot:

Step 3 : Add a image for each author to your child themes images folder like you see in the following screenshot:

Make sure the image file name for each author matches the file name in the PHP code.

This solution enables you to customize the authors image using code in your child theme rather than a plugin. The custom avatar image will display in the author box as well as the comments.

Here’s the code for logged in members:

Register for full access

Related Tutorials

  • Custom Avatar In Genesis
  • Custom Avatars In Any WordPress Theme

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

Code written by Brad Dalton specialist for Genesis, WooCommerce & WordPress theme customization. Read More…

Advertise · WPEngine · Genesis · Log in

  • Access Problems
  • Account Details
  • Consulting
  • Tags
 

Loading Comments...
 

You must be logged in to post a comment.