Quantcast
Channel: WPKube » Snippets
Viewing all articles
Browse latest Browse all 9

Quick Tip: Display avatar for currently logged in user

$
0
0

How about displaying the avatar for current logged in user?

By Default it comes with a get_avatar function. Adding this snippet to your wordpress template will display the currently logged in users avatar in your theme.

To adjust the side of the avatar change the number 64 within the get_avatar function default is 96 and max size is 512.

<?php
       global $current_user;
       get_currentuserinfo();
       echo get_avatar( $current_user->ID, 64 );
?>

The post Quick Tip: Display avatar for currently logged in user appeared first on WPKube.


Viewing all articles
Browse latest Browse all 9

Trending Articles