Avada › Forums › Community Forum › change default avatar size
Tagged: avatar
-
AuthorPosts
-
The avatar size is set to 50×50.
How do I change the size to make it larger?
That code isn’t in the comments.php file.
Just to be clear I’m trying to change this image: https://ibb.co/sqBgpNR
Hi nextoronto,
>> Just to be clear I’m trying to change this image: https://ibb.co/sqBgpNR
Yes. This is what I assumed.>> That code isn’t in the comments.php file.
Hmmmm, I see it in the Avada install here https://imgur.com/06Y1Ur0—
After Duck Duck Going this a bit more for you, I found out that you can override the
avada_comment
function using your child theme’s functions.php. In this example, line 310 is probably the one you want to override.See the WordPress Codex as a allusion for overloading
avada_comment
(using TwentyTen as an example).WordPress Codex for comments.php
https://core.trac.wordpress.org/browser/tags/5.2.3/src/wp-content/themes/twentyten/comments.php#L0
WordPress Codex for
get_avatar
https://developer.wordpress.org/reference/functions/get_avatar/
Hi Markichavez,
I just installed child theme a few minutes ago to change avatar size but I can’t find line 310 or anything with the word avatar. My child’s function php has only 12 lines.Can you help with this one.
Thanks
Hey @aleamio,
I think you should read-up what a child theme is and how to override functions.
https://theme-fusion.com/documentation/avada/install-update/avada-child-theme/
Anyway, in this case for avatar size, I don’t think overriding will work. So, forget what I suggested above. Sorry for the confusion.
But, just to be sure, I’d double check with support to confirm if my guess is true.
Ok, if you decide to dig hard enough into the code, you will see that
get_avatar()
is called at least one time in the Avada theme files to display comments. Unfortunately, it’s called with a hardcoded54
. If you find that code, you can change that up to96
. I did it and it worked fine. But, I never recommend updating theme core files.The quick and dirty and more safe way is to change the CSS. The trick (as always) is to find the correct CSS selector that will work for you.
For example, this code works on one of my blog posts.
.avatar.avata-54.pho.lazyloaded { width: 96px; height: 96px; }
So, I hope you are a skilled Firefox or Chrome dev tools person.
Enjoy!
Yes. Markichaves, thanks I found mine and it is working at 96 which is a bit bigger than I want but I will toy with it.
Thanks again.
Hi Markichaves,
I am trying to do the same as i am using dynamic content to show the author. But default is 96 and i have changed theme files comments.php also tried changing the get_avatar defaults i have changed css but then the quality of the image is very poor.
Can you have a look at the bottom of this page:
https://askemo.nl/continu-verbeteren-zorgt-voor-goed-onderwijs/For now i have deleted CSS because avatars went blurry.
Kr Rody
-
AuthorPosts
- You must be logged in to reply to this topic.