• My theme’s comments are only showing either gravatars or the gravatar logo. Custom avatar plugins don’t work, changing the default gravatar image in settings / discussion doesn’t do anything, and a facebook comment import plugin does not pull profile photos to be used as avatars like it should.

    I’ve narrowed it down I believe is the issue. my theme has an “unsorted.php” and this appears there:

    <aside class="comment__avatar  media__img">
    
    	<!-- custom gravatar call -->
    			<?php $bgauthemail = get_comment_author_email(); ?>
    			<img src="https://www.gravatar.com/avatar/<?php echo md5($bgauthemail); ?>?s=60" class="comment__avatar-image" height="60" width="60" style="background-image: <?php echo get_template_directory_uri(). '/library/images/nothing.gif'; ?>; background-size: 100% 100%" />
    		</aside>

    I’m far from a coder, but I was at one point in messing around in there, able to get the avatars to load to the default “mystery man” rather than the G logo. But it was all out of wack.

    The only other mention of avatar in a file I can find is the following, but I haven’t really played around with it to see if it does anything…

    /**
    	 * Return the URL to a user's gravatar
    	 *
    	 * @param   string  $email  The email of the user
    	 * @param   int     $size   The size of the gravatar
    	 * @return  string
    	 *
    	 * @access  public
    	 * @since   1.0.000
    	 * @static
    	 */
    	static function get_gravatar( $email, $size = 32 )
    	{
    		if ( self::is_https() ) {
    			$url = 'https://secure.gravatar.com/';
    		} else {
    			$url = 'https://www.gravatar.com/';
    		}
    
    		$url .= 'avatar/' . md5( $email ) . '?s=' . (int) abs( $size );
    
    		return $url;
    	}
    
    	static function get_avatar_url($email, $size = 32){
    		$get_avatar = get_avatar($email, $size);
    
    		preg_match('/< *img[^>]*src *= *["\']?([^"\']*)/i', $get_avatar, $matches);
    		if (isset($matches[1])) {
    			return $matches[1];
    		} else {
    			return '';
    		}
    
    	}

    Basically I just want to fix the issue of loading gravatars only, or the Gravatar logo default only… any help would be appreciated! My theme’s comments.php doesn’t have anything about calling avatars. Neither does functions.php.

  • The topic ‘Comments showing only Gravatar or Gravatar Logo’ is closed to new replies.