• Resolved Nutmegan

    (@nutmegan)


    I’m running WP 4.1.1 along with BuddyPress and bbPress.

    Blog comments are not showing the users avatar and instead are showing the following placeholder text: “Nutmegan’sGravatar”

    I don’t use Gravatar on my site, I use a custom avatar plugin. Switching to other themes works just fine.

    Edit: Link to a sample comment page

Viewing 5 replies - 1 through 5 (of 5 total)
  • It looks as if the theme specifically calls for gravatar.

    Do you get the same behavior if you paste the following code into your child theme functions.php file? (do so carefully, and preferably through FTP and not the WordPress dashboard)

    function evolve_comment_avatar( $avatar = true, $gravatar_size = 45 ) {
    	global $comment;
    	$author = get_comment_author();
    
    	if ( $avatar ) {
    		// Get author's gavatar
    		$gravatar_email = get_comment_author_email();
    		$gravatar_size = apply_filters( 'evolve_gravatar_size', (int) $gravatar_size ); // Available filter: evolve_gravatar_size
    		$gravatar = get_avatar( $comment, $gravatar_size );
    
    		// get the $src data from $gavatar
    		if ( preg_match( '/src=\'(.*?)\'/i', $gravatar, $matches ) )
    			$src = $matches[1];
    
    		// Rebuild Gravatar link because get_avatar() produces invalid code :/ (P.S. adds "gravatar" class)
    		$output = "<img class=\"avatar gravatar gravatar-{$gravatar_size}\" alt=\"{$author}'s Gravatar\" src=\"{$src}\" width=\"{$gravatar_size}\" height=\"{$gravatar_size}\" />";
    
    		if (get_option('show_avatars')){  // Avatars enabled?
    			return apply_filters( 'evolve_comment_avatar', (string) $output ); // Available filter: evolve_comment_avatar
    		}
    	}
    }

    That slightly modifies the method for retrieving the image. Let me know.

    Thread Starter Nutmegan

    (@nutmegan)

    Apologize for the delayed response. I was still tinkering with the idea of using the theme and hadn’t setup the child so I had to take care of that and fix it first.

    I pasted your snipet into my child functions and it didn’t do anything. Thank you for the effort though.

    It seems like a huge oversight on the developers side to assume only gravatar avatars. So many people use custom avatar options??? Maybe I have another plugin conflict. I’ll have to do some more investigating. (turn off some other plugins)

    Hi there,

    Thanks for writing in,

    Would you mind providing us with more thorough clarification in concern of your problematic issue and also some screenshots which might me useful for us to investigate more closely and will provide you with more tailored answer and detailed response.

    Thanks.

    Thread Starter Nutmegan

    (@nutmegan)

    Thanks for checking. I can’t really give you any more information. I liked the theme so much I upgraded to the Plus version and they fixed it for me over there in the support forum.

    Good luck with that! ??

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Blog Comment Avatar Replaced with Placeholder Text’ is closed to new replies.