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 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.

This topic contains 3 replies, has 2 voices.

Last updated by Minesh 3 years, 4 months ago.

Assigned support staff: 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