Legacy: Modify the Author Avatar

This version of the Layouts feature has been retired. PublishPress Authors is now using a new approach called “Author Boxes“.

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 Google's 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