avatar size

This topic contains 2 replies, has 2 voices, and was last updated by  ganymod 5 years, 7 months ago.

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket
  • Author
    Posts
  • #3805

    ganymod
    Buyer
    Post count: 1

    Hello,

    How can I change the avatar size?
    specified are 150×150 px

    how can i change it to for example: 100x100px?

    many thanks for the help,
    greetings Jürgen

    #3806

    Patrik
    Moderator
    Post count: 1971

    Hi,

    We have used the default gravatar function of WordPress. You can use the following code to change the size of the gravatar:

    add_filter('pre_get_avatar_data', 'pre_get_avatar_data_cb', 10, 1);
    function pre_get_avatar_data_cb($args){
    if(is_uwp_profile_page()){
            $args['size'] = 100;
            $args['width'] = 100;
            $args['height'] = 100;
            return $args;
        }
        return $args;
    }

    Please note: This will change the size of gravatar for the profile page. So if you want to change the size of gravatar on the other pages then you can use the conditional tags.

    Regards,
    Patrik

    #3807

    ganymod
    Buyer
    Post count: 1

    many thanks for the answer

    greetings Jürgen

Viewing 3 posts - 1 through 3 (of 3 total)

We have moved to a support ticketing system and our forums are now closed.

Open Support Ticket