Title: get_currentuserinfo error
Last modified: August 19, 2016

---

# get_currentuserinfo error

 *  [jasontower](https://wordpress.org/support/users/jasontower/)
 * (@jasontower)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/get_currentuserinfo-error/)
 * I want to show some info of current user, so I save the example code in a php
   file under domain root folder:
    <?php global $current_user; get_currentuserinfo();
   echo ‘Username: ‘ . $current_user->user_login . “\n”; echo ‘User email: ‘ . $
   current_user->user_email . “\n”; echo ‘User level: ‘ . $current_user->user_level.“\
   n”; echo ‘User first name: ‘ . $current_user->user_firstname . “\n”; echo ‘User
   last name: ‘ . $current_user->user_lastname . “\n”; echo ‘User display name: ‘.
   $current_user->display_name . “\n”; echo ‘User ID: ‘ . $current_user->ID . “\
   n”; ?> but when load that page, nothing happens but a blank page. How to solve
   it? Thanks!

Viewing 1 replies (of 1 total)

 *  [jceresini](https://wordpress.org/support/users/jceresini/)
 * (@jceresini)
 * [16 years, 8 months ago](https://wordpress.org/support/topic/get_currentuserinfo-error/#post-1212811)
 * Is that the full contents of the php file? Are you accessing that file directly
   in a browser or is it included in another file. If no, those functions are not
   defined when the code is executed. In that case you probably want to add the 
   following to the top of your page:
 * require(‘./wp-blog-header.php’);
 * Since you’re getting a completly blank page though, I’d recommend looking at 
   the php error logs. They should tell you why the page isn’t rendering at all.
 * [**signature moderated** Please read the [Forum Rules](http://wordpress.org/support/topic/68664?replies=6)]

Viewing 1 replies (of 1 total)

The topic ‘get_currentuserinfo error’ is closed to new replies.

 * In: [Fixing WordPress](https://wordpress.org/support/forum/how-to-and-troubleshooting/)
 * 1 reply
 * 2 participants
 * Last reply from: [jceresini](https://wordpress.org/support/users/jceresini/)
 * Last activity: [16 years, 8 months ago](https://wordpress.org/support/topic/get_currentuserinfo-error/#post-1212811)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
