WordPress.org

Ready to get started?Download WordPress

Forums

Jetpack by WordPress.com
[resolved] Comments: Gravatar image broken (7 posts)

  1. h8usernames
    Member
    Posted 1 year ago #

    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/

  2. Jeremy Herve
    Happiness Engineer
    Plugin Author

    Posted 1 year ago #

    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

  3. h8usernames
    Member
    Posted 1 year ago #

    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.

  4. Manuel Schmalstieg
    Member
    Posted 5 months ago #

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

  5. Manuel Schmalstieg
    Member
    Posted 5 months ago #

    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'] ); }

  6. h8usernames
    Member
    Posted 5 months ago #

    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

  7. Manuel Schmalstieg
    Member
    Posted 5 months ago #

    Thanks Ryan,

    Indeed, that's also a solution - that's how it's done in TwentyThirteen and TwentyFourteen.

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic