ImagePress: How to add a default avatar

Follow me!

If you like this article, go ahead and follow me on Twitter:

Follow @getButterfly

ImagePress Author Discovery

This small function allows you to change the default WordPress avatar when using ImagePress and skip all WordPress-generated ones.

This feature works with ImagePress version 7 or higher.

add_filter('avatar_defaults', 'imagepress_default_gravatar');

function imagepress_default_gravatar($avatar_defaults) {
    $myavatar = 'path/to/your/avatar.jpg';
    $avatar_defaults[$myavatar] = 'Default ImagePress Avatar';

    return $avatar_defaults;
}

Use this in your theme’s functions.php file or in a custom plugin.

👋 Added by Ciprian on Tuesday, July 17, 2018 in Blog, ImagePress. Last modified on Monday, July 16, 2018.

Contribute!

Contribute to this article by sharing your opinion on Twitter:

Unlimited Automated Page Speed Monitoring & Tracking.
Use SpeedFactor to track your website. It’s simple and reliable.
See how real people experience the speed of your website. Then find (and fix) your web performance problems.
Get Started
Privacy Policy