Table of Contents

Modify the Author Avatar

It is possible to modify the output of the authors' avatars in the PublishPress Authors plugin.

One use-case we've seen was replacing the <img tag with <amp-img. This is useful for a site that supports Googl'e AMP protocol.

The best way to do this is by adding this code to your theme's functions.php file:

add_filter('multiple_authors_get_avatar', 'amp_replace_img_tag', 10, 3);
function amp_replace_img_tag($avatar, $author, $size)
{
    $avatar = str_replace('<img', '<amp-img', $avatar);

    return $avatar;
}

Professional publishing plugins for WordPress! Get PublishPress