WordPress.org

Ready to get started?Download WordPress

Forums

[Plugin: Add Local Avatar] Display avatars anywhere in wordpress (5 posts)

  1. dkblackhawk
    Member
    Posted 4 years ago #

    What code would i need so that i can display the avatar of the current user anywhere in wordpress. I need to know how for a avatar project on the bbpress forums im working on.

  2. Shane G
    Member
    Posted 4 years ago #

    Hi,

    Read this article:

    http://codex.wordpress.org/Using_Gravatars

    Or have a check with this plugin:

    http://wordpress.org/extend/plugins/post-avatar/

    Thanks,

    Shane G.

  3. dkblackhawk
    Member
    Posted 4 years ago #

    Yeah i tried the links you gave me but none of them seem to have helped, thanks for trying though.

  4. peterwsterling
    Member
    Posted 4 years ago #

    Try something like this:

    <?php
    	global $current_user;
    	if(!empty($current_user->id) {
    		echo "<div class='avatar'>", get_avatar($current_user->id, 30), "</div>";
    	}
    ?>
  5. dkblackhawk
    Member
    Posted 4 years ago #

    Thanks worked like a charm :P

Topic Closed

This topic has been closed to new replies.

About this Topic