Title: Problems Displaying Current User&#8230;?
Last modified: August 18, 2016

---

# Problems Displaying Current User…?

 *  [garethdaine](https://wordpress.org/support/users/garethdaine/)
 * (@garethdaine)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/problems-displaying-current-user/)
 * Hi,
 * I am new to using WordPress 2.0 as my WebLog software and was wondering does 
   anyone know how to display the name of the currently logged in user?
 * For example my username is ‘Gareth’ and on the sidebar on the right of my site
   I would like it to display that username their when I am logged in and also to
   do the same for the users of my site.
 * This is my website [http://www.truthmedia.co.uk](http://www.truthmedia.co.uk)
 * Can you help? If so the help would be much appreciated. Thanks in advance.
 * Regards
 * Gareth

Viewing 9 replies - 1 through 9 (of 9 total)

 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/problems-displaying-current-user/#post-316405)
 * Don’t crosspost and don’t be impatient. 29 minutes waiting is nothing!
    When 
   a knowledgable member will come around – they will answer your question. [I deleted
   your duplicate post]
 *  Thread Starter [garethdaine](https://wordpress.org/support/users/garethdaine/)
 * (@garethdaine)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/problems-displaying-current-user/#post-316406)
 * Hi,
 * I’m sorry for being impatient. My apologies. I didn’t mean to offend. I will 
   not cross post again.
 * Regards
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/problems-displaying-current-user/#post-316407)
 * Good. Then you can go now and read this thread 🙂
    [http://wordpress.org/support/topic/55135?replies=18](http://wordpress.org/support/topic/55135?replies=18)
 *  Thread Starter [garethdaine](https://wordpress.org/support/users/garethdaine/)
 * (@garethdaine)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/problems-displaying-current-user/#post-316408)
 * Hi,
 * Thank you, I will. I am sorry I am very tired as it is 04:53 am here and I just
   wanted to get this done so I could get some sleep. Wrong course of action I know,
   so again apologies. Thank you for the help.
 * Regards
 *  Thread Starter [garethdaine](https://wordpress.org/support/users/garethdaine/)
 * (@garethdaine)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/problems-displaying-current-user/#post-316410)
 * Hi,
 * Unfortunatly I don’t know were I am supposed to implement this code?
 * global $user_identity;
    get_currentuserdata(); if ($user_identity) { echo “Hi
   $user_identity!”; }
 * Any ideas?
 * Regards
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/problems-displaying-current-user/#post-316411)
 * Where you want it to appear. You mentioned the sidebar. That would be the sidebar.
   php file in your theme.
 *  Thread Starter [garethdaine](https://wordpress.org/support/users/garethdaine/)
 * (@garethdaine)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/problems-displaying-current-user/#post-316413)
 * I have implemented the code in the side bar but it returns an error.
 * This code seems to work but does not shoe the username, probably because of the
   reason stated in the thread you gave me, i.e. $user_identity isn’t defined outside
   of wp-admin.
 * <?php printf(__(‘Hello, **%s**.’), $user_identity) ?>
 * I receive the following error upon trying to implement this code in the side 
   bar:-
 * Code:-
 * global $user_identity;
    get_currentuserdata(); if ($user_identity) { echo “Hi
   $user_identity!”; }
 * Error:-
 * Fatal error: Call to undefined function: get_currentuserdata() in C:\Inetpub\
   vhosts\truthmedia.co.uk\httpdocs\wp-content\themes\blix\sidebar.php on line 56
 * Regards
 *  Thread Starter [garethdaine](https://wordpress.org/support/users/garethdaine/)
 * (@garethdaine)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/problems-displaying-current-user/#post-316414)
 * Hi,
 * It’s ok I have figured it out.
 * All I did was combine and edit the two sets of code to produce this:-
 * <?php global $user_identity;
    printf(__(‘Hello, **%s**.’), $user_identity) ?>
 * It works like a charm now :D. Thank you for your help Moshu, much appreciated.
   Sorry again for the impatience.
 * Regards
 * Gareth
 *  [moshu](https://wordpress.org/support/users/moshu/)
 * (@moshu)
 * [20 years, 5 months ago](https://wordpress.org/support/topic/problems-displaying-current-user/#post-316416)
 * The other also should work if you change currentuserdata => currentuserinfo.
   
   I don’t use any of them, just checked out now 🙂

Viewing 9 replies - 1 through 9 (of 9 total)

The topic ‘Problems Displaying Current User…?’ is closed to new replies.

## Tags

 * [online](https://wordpress.org/support/topic-tag/online/)
 * [Stats](https://wordpress.org/support/topic-tag/stats/)
 * [user](https://wordpress.org/support/topic-tag/user/)
 * [users](https://wordpress.org/support/topic-tag/users/)

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 9 replies
 * 2 participants
 * Last reply from: [moshu](https://wordpress.org/support/users/moshu/)
 * Last activity: [20 years, 5 months ago](https://wordpress.org/support/topic/problems-displaying-current-user/#post-316416)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
