Simple Facebook Connect
[resolved] My Theme calls avatar differently (3 posts)

  1. sruddy
    Posted 4 years ago #

    What do I need to change to make my FB avatars show up instead of the themes gravatars. Here is the themes code.

    // Produces an avatar image with the hCard-compliant photo class
    function commenter_link() {
    	$commenter = get_comment_author_link();
    	if ( ereg( '<a[^>]* class=[^>]+>', $commenter ) ) {
    		$commenter = ereg_replace( '(<a[^>]* class=[\'"]?)', '\\1url ' , $commenter );
    	} else {
    		$commenter = ereg_replace( '(<a )/', '\\1class="url "' , $commenter );
    	$avatar_email = get_comment_author_email();
    	$avatar = str_replace( "class='avatar", "class='photo avatar", get_avatar( $avatar_email, 80 ) );
    	echo ' <a href="'.get_comment_author_url().'" title="Comment Author">'.$avatar .'</a>';
    } // end commenter_link

    [Moderator Note: Please post code or markup snippets between backticks or use the code button. As it stands, your code may now have been permanently damaged/corrupted by the forum's parser.]


  2. Samuel Wood (Otto)
    WordPress.org Tech Dude
    Plugin Author

    Posted 4 years ago #

    At the beginning of the function, add this line:

    global $comment;

    Then, where it has this code:

    get_avatar( $avatar_email, 80 )

    Change it to this:

    get_avatar( $comment, 80 )

  3. sruddy
    Posted 4 years ago #

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic


No tags yet.