• r3bb

    (@r3bb)


    Hi,

    I recently installed Adam Hupp’s WP-fbconnect plugin and it’s working fantastic, except for one problem: I can’t seem to get the user avatars to play nicely with the default ones in WordPress.

    When a user is signed into facebook and leaves a comment on the blog post, the plugin should use their facebook profile picture as their avatar. I can get this to work if I insert the following code where I want the facebook avatar to display:

    <?php echo get_avatar( $comment, 32 ); ?>

    Unfortunately, the default WordPress avatar shows also. So I end up with 2 different avatars for each comment, which looks really bad. There is a setting in the WordPress discussion settings panel that lets me choose a blank avatar, but the width of that avatar still pushes the user’s name over to the right, which creates an empty space between the post number and the user’s name.

    Can anyone tell me how to turn on avatars but use an avatar that has a pixel width of 0 or 1? That might do the trick.

    Thanks,

    -r3bb

Viewing 10 replies - 1 through 10 (of 10 total)
  • Thread Starter r3bb

    (@r3bb)

    For reference, my blog is located at https://www.darwinspet.com/blog

    alism

    (@alism)

    Isn’t there a ‘don’t show avatars’ option on the same page?

    Thread Starter r3bb

    (@r3bb)

    Yes, but when I check that option, it suppresses all avatars, even the ones from facebook.

    Michael

    (@alchymyth)

    it may help, if you post a link to a post with comments, where the two avatars show, so we can check if they are styled by different tags, or if not.

    to suppress the ‘wordpress’ avatar, you could add ‘display:none;’ to the respective style in style.css:

    #comments-list .comment-author img.avatar {
    	float: left;
    	margin-right: 0.5em;
      display:none;
    }

    or are you asking for a conditional code: if facebook avatar: show this and no other; else: show wordpress avatar ?
    is there no support for the plugin?

    Thread Starter r3bb

    (@r3bb)

    alchymyth,

    First, thank you for your help! I know it would help if I provided a link to some comments that have both the facebook and wordpress avatars displaying, but in order to do that I’d have to have that display for every single comment on my blog. It looks very unprofessional, so I’m unwilling to do that.

    However, I do think you’re onto something with the code above. Suppressing the wordpress avatar is one option, but in the case that people don’t have a facebook avatar, they would be left witn no avatar at all. So yes, what would be perfect is a conditional code: if facebook avatar: show this and no other; else: show wordpress avatar.

    How can I do that?

    Michael

    (@alchymyth)

    i will have a go at it tomorrow ??

    Samuel B

    (@samboll)

    stop bumping – against the rules!

    Michael

    (@alchymyth)

    unfortunately, your plugin seems to use the uses the same call of the avatar than the standard comments function.
    it could be that not adding the extra line will still show facebook avatars if available.
    if you like, you could post the html code of a page with both comments activated here in a pastebin.

    Thread Starter r3bb

    (@r3bb)

    Thanks alchymyth, here’s the link to the pastebin code:

    https://wordpress.pastebin.com/m1362076a

    Please note that the get_avatar code calls and displays the facebook picture.

    <?php echo get_avatar( $comment, 32 ); ?>

    Michael

    (@alchymyth)

    thank you for posting the code. i can only find one ocurrance of get_avatar, so i don’t see why there should be two avatar images on the same comment.
    without a live link to a comment where this ocurs, any help has to stop here.
    maybe more support is available from the plugin author?

Viewing 10 replies - 1 through 10 (of 10 total)
  • The topic ‘User avatars in comments’ is closed to new replies.