WordPress.org

Ready to get started?Download WordPress

Forums

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

  1. sruddy
    Member
    Posted 1 year 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.]

    http://wordpress.org/extend/plugins/simple-facebook-connect/

  2. Samuel Wood (Otto)
    Tech Ninja
    Plugin Author

    Posted 1 year 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
    Member
    Posted 1 year ago #

    Thank you!

Topic Closed

This topic has been closed to new replies.

About this Plugin

About this Topic

Tags

No tags yet.