How do I get a smaller size of an avatar image

I have a function that creates a bio-line at the top of every post. One part gets the avatar of that user, that he uploaded in WordPress (I use a plugin so people don't need to use Gravatar for this).

function mm_author_byline()
{
    if (is_single() AND (get_post_type() == 'post' OR get_post_type() == 'theme_product_review')) {
        ?

        div class=mm-byline-image
            ?= get_avatar(get_the_author_meta('ID')) ?
        /div

        ?php
    }
}

The problem now is, that this image is neither cropped, nor is it sized down. It takes the original image, that can be huge. How can I get a sized down version of the avatar image?

Topic thumbnails avatar cropping images Wordpress

Category Web


get_avatar takes a second parameter according to the documentation for avatar size. If you're using a plugin that doesn't respect that, you'll need to reach out or check their documentation for a way to change the size.

About

Geeks Mental is a community that publishes articles and tutorials about Web, Android, Data Science, new techniques and Linux security.