Skip Navigation

[Resolved] How do I display an authors gravatar image in content template used for an archi

This thread is resolved. Here is a description of the problem and solution.

Problem:
How to display author gravatar image

Solution:
To display the author's aravatar image, you need to add custom shortcode to your current theme's functions.php file.

You can find proposed solution, in this case, with the following reply:
=> https://toolset.com/forums/topic/how-do-i-display-an-authors-gravatar-image-in-content-template-used-for-an-archi/#post-854160

Relevant Documentation:

This support ticket is created 6 years, 6 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
- 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 10:00 – 13:00 -
- 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 14:00 – 18:00 -

Supporter timezone: Asia/Kolkata (GMT+05:30)

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 6 years, 6 months ago.

Assisted by: Minesh.

Author
Posts
#853645

Hello,

How do I display an authors gravatar image in content template that I am using for a archive layout. I cant seem to find out how to do that.

thanks,

#854160

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Hello. Thank you for contacting the Toolset support.

Well - To display the author's aravatar image, you need to add custom shortcode to your current theme's functions.php file.

function my_gravatar($atts) {
   return get_avatar( $atts['email'] );
}
add_shortcode('my-gravatar', 'my_gravatar');

Then you can use it as example as follows:

[my-gravatar email="[wpv-post-author format='meta' meta='user_email']"]
#856939

okay, and how to I make it a larger size, thanks for your help

#857050

Minesh
Supporter

Languages: English (English )

Timezone: Asia/Kolkata (GMT+05:30)

Well - as you can see with the get_get_avatar() codex, it supports the size attribute. You should pass the size attribute to function as per your need.

More info:
=> https://codex.wordpress.org/Function_Reference/get_avatar