WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: WP-FacebookConnect] use $object->user_id in get_avatar() (3 posts)

  1. pantsonhead
    Member
    Posted 4 years ago #

    If you are using get_avatar() outside of comments (e.g. profile page), make sure you pass an object with a user_id property not just the user_id or the FB avatar will not be loaded.

    http://wordpress.org/extend/plugins/wp-facebookconnect/

  2. mcardlej@gmail.com
    Member
    Posted 4 years ago #

    Hi,
    Thanks for posting this, I've been having the exact same issue. However I can't seem to get it working as I'd expect. Are you able to post a code snippet?

    My guess is; <?php echo get_avatar($object->user_id, '96'); ?>
    But still doesn't seem to work...

    Cheers,
    James.

  3. pantsonhead
    Member
    Posted 4 years ago #

    Hi James

    That is incorrect, you are still just passing the object's user_id value, just use this (as long as $object->user_id exists):

    <?php echo get_avatar($object, '96'); ?>

Topic Closed

This topic has been closed to new replies.

About this Topic