Viewing 11 replies - 1 through 11 (of 11 total)
  • Hi Alex,

    Try to locate the php line that calls the avatar images in your theme’s single.php or comments.php file, and manually edit the size value to shrink them.

    Cheers!

    Thread Starter alex586

    (@alex586)

    Hi,

    I’ve juste found this line in comments.php

    <?php echo get_avatar($comment,$size='50'); ?>

    And avatars are not resized :/

    Hi Alex,

    I think that code is wrong according to the get_avatar codex article. Try this instead:
    <?php echo get_avatar( $comment, 32 ); ?>
    You can replace 32 by whatever value fits your design better.
    Let me know if it works.

    Thread Starter alex586

    (@alex586)

    Thanks but doesn’t work ;

    That’s odd…
    Could you post a link to your site so I can take a look?
    Thanks!

    Thread Starter alex586

    (@alex586)

    Yes, of course !
    https://taspas1po.fr/

    Ok, I just posted a test comment on your post called Se faciliter la vie and it is retrieving the right image size, ie., 50 pixels.
    I think I know what your problem is: WordPress is wired to retrieve avatars from Gravatar, which is an online avatar tool by the same company behind WP.com, Automattic. I think your users are using a different online avatar tool, so the avatar images are not getting resized properly by WordPress.
    I don’t know a solution for this problem, but something that could work is use a script (JS might work) to intercept img tags inside your comments section and assign fixed height and width attributes to them, which would force the non-gravatar avatars to resize.
    Also, have you tried contacting the company that developed the theme? Since this is a premium template, they might offer you support.

    Actually, I was taking a look at your code, and I see no reason why a .CSS resize would not work. Look for the following code inside your theme’s style.css file, which should be located in the folder wp-content/themes/Glow/style.css:

    #main-area-wrap .comment-author img.avatar {
        background: none repeat scroll 0 0 #EDEDED;
        border: 1px solid #DBDBDB;
        float: left;
        padding: 5px;
    }

    And replace it with:

    #main-area-wrap .comment-author img.avatar {
        background: none repeat scroll 0 0 #EDEDED;
        border: 1px solid #DBDBDB;
        float: left;
        height: 50px!important; /* You can change this value */
        padding: 5px;
        width: 50px!important; /* You can change this value */
    }

    LMK if this works!

    Thread Starter alex586

    (@alex586)

    Good News, it’s working !
    Many thanks for your excellent support !

    Glad to hear it worked.
    Let me know if you have any more problems.
    Cheers!

    Hi Alex,

    I forgot to ask you if you could please mark this thread as resolved.
    Thanks!

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘Size of avatar’ is closed to new replies.