WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Twitter->Gravatar Avatar used in post. (3 posts)

  1. cozbaldwin
    Member
    Posted 4 years ago #

    I feel like this should be easy, yet after trying multiple plug-ins and different functions, I cannot get it working.

    Ok - so I maintain an open-to-the-public blog which invites anyone to log in using standard wordpress methods OR use their Twitter account to write up a post (or comment).

    I would like their avatar to show at the top of the post the write. If they logged in using Twitter, their Twitter icon would display. Otherwise, their Gravatar (if it exists) will display.

    I can get this working in the Comments just fine. A user logs in using twit-connect, posts their comment, and their av shows. But for some reason, when that same person writes a post... It ignores Twitter and only shows default gravatar.

    Any ideas?

    I've used Twitter & Twicon for WordPress plugins. I tried hacking functions.php to create a new function based on techniques described here: http://www.wprecipes.com/wordpress-hack-automatically-insert-author-bio-on-each-post -- but nothing works! All the Twitter functions look for is the email of the twitter user, which they dont ever put in.

  2. cozbaldwin
    Member
    Posted 4 years ago #

    Ok - so after about 10 different ways of trying to get the avatar, it seems this works for users who use Twitter Connect to log in and post a blog entry. It will use their Twitter icon. If they have a Gravatar, then it will use the Gravatar:

    <?php echo get_avatar($post->post_author); ?>

    You can see how this is being used here:
    http://www.hiddeninthesand.com/blogs/

  3. eivindvr
    Member
    Posted 4 years ago #

    I´m looking for the exact same thing!
    I tried the <?php echo get_avatar($post->post_author); ?> but it only pulls the WP default avatar:-(

    I would like to use both facebook and twitter avatars for posts.
    I´m using them for commenst and recents comments and it works fine.

    How can I use the twitter/facebook avatars to my post author?

    /eivind

Topic Closed

This topic has been closed to new replies.

About this Topic