WordPress.org

Support

Support » Plugins and Hacks » Jetpack by WordPress.com » [Resolved] Comments: Gravatar image broken

[Resolved] Comments: Gravatar image broken

  • With Jetpack comments, when a user without a Gravatar profile posts a comments we get a broken image link.

    I have tried with using Gravatar hovercards and with not using Gravatar hovercards but there is no difference.

    I cannot find any settings to not use Gravatar at all and this problem is making my site look unprofessional. I have tried turning off avatars all together and this technically does work but the site doesn’t look as good or engaging.

    You can see an example of what is going on at with this post.

    Currently we have Gravatar hovercards turned off.

    Thanks for your help

    http://wordpress.org/extend/plugins/jetpack/

Viewing 6 replies - 1 through 6 (of 6 total)
  • Plugin Author Jeremy Herve

    @jeherve

    Jetpack Comments changes the look of the comment form, but doesn’t actually affect the way the comments are displayed on your site. This is entirely controlled by your theme.

    I would suggest that you check your theme’s comments.php file, as well as the function controlling the comment list, and make sure the avatar fallback is correct. You can see how Twenty Twelve does it here:
    http://core.trac.wordpress.org/browser/trunk/wp-content/themes/twentytwelve/functions.php#L301

    Thanks for that Jeremy, I am using a 3rd part theme so checked out their forum and found a solution – all is well in the world now that it’s working.

    @h8usernames, can you please give some more info on how you solved the problem?

    Ok, upon inspection, it appears to be some buggy code in the theme’s custom mytheme_comment function.

    The faulty code (doesn’t work):

    echo get_avatar($comment,$size='48',$default='<path_to_url>' );

    This isn’t proper php syntax. The declarations for $size and $default (URL of default avatar) would work if written like this:

    echo get_avatar($comment,48,'<path_to_url>' );

    And the ‘<path_to_url>’ must be a valid url, of course.

    Versions that work, in standard WordPress themes:

    In twenty_twelve:

    echo get_avatar( $comment, 44 );

    In underscores_theme:

    if ( 0 != $args['avatar_size'] ) { echo get_avatar( $comment, $args['avatar_size'] ); }

    Manuel,
    What I ended up doing is replacing the themes custom comment form with the standard WordPress function comment_form()

    I also found a number of errors in the PHP on the theme I used and the benefits of the custom form just were not great enough to keep it.

    Regards,
    Ryan

    Thanks Ryan,

    Indeed, that’s also a solution – that’s how it’s done in TwentyThirteen and TwentyFourteen.

Viewing 6 replies - 1 through 6 (of 6 total)
  • The topic ‘[Resolved] Comments: Gravatar image broken’ is closed to new replies.
Skip to toolbar