avatar size

This topic contains 2 replies, has 2 voices, and was last updated by  ganymod 2 weeks, 2 days ago.

  • Author
    Posts
  • #3805

    ganymod
    Free User
    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: 891

    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
    Free User
    Post count: 1

    many thanks for the answer

    greetings Jürgen

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

You must be logged in to reply to this topic.