Site logo

Archived topic

avatar size in comments

3 replies · Started by Igor on November 29, 2015

Viewing posts 1–4 of 4

Hello,

i would like avatars in comments of 80px width instead of 50px width in my child theme.

i dupplicate the comment.php to my child theme

i found in the parent theme file : inc/template-tags.php the

$args['avatar_size'] = 50;

But i don't know how to change this value without modify the parent theme "template-tags.php".

(I am a beginner )

Thanks

Hi there,

I just added a new filter into the next version which will make this easier.

First, find this in the template-tags.php file:

$args['avatar_size'] = 50;

And replace it with this:

$args['avatar_size'] = apply_filters( 'generate_comment_avatar_size', 50 );

Then add this function:

add_filter( 'generate_comment_avatar_size','generate_change_avatar_size' );
function generate_change_avatar_size()
{
    return 80;
}

Adding PHP: https://generatepress.com/knowledgebase/adding-php-functions/

Hello,

Thank you, it's working !
( I put your "add filter" code into my child theme's function.php )

So in the next version of GeneratePress,$args['avatar_size'] = apply_filters( 'generate_comment_avatar_size', 50 ); will not be undone ?

Thanks !

Perfect.

That's correct, the next version will include the filter by default :)

This archived topic is closed to new replies.