• I have a page in my theme that uses the following code:

    global $current_user;
    get_currentuserinfo();
    echo 'Username: ' . $current_user->user_login . "\n";
    echo 'User ID: ' . $current_user->ID . "\n";

    Even though I’m logged in as an administrator, the code returns null values for $current_user->user_login and $current_user->ID = 0. I’ve tried disabling all plugins and re-installing WP 3.3.1, but can’t seem to get the user info to show up. This was working when I first installed 3.3.1, and I don’t know of any changes that have happened since then.

    Any help would be much appreciated.

Viewing 1 replies (of 1 total)
  • Thread Starter sees

    (@sees)

    I’ve narrowed this issue down to the user account I was using. Other admin accounts seem to work fine, and populate the $current_user variables appropriately.

    After looking through the user_meta fields in the database, I didn’t find anything particularly different about the buggy user account, so I guess the best resolution that I’ve found is to create a new user account and delete the old one.

Viewing 1 replies (of 1 total)
  • The topic ‘Users not recognized in theme’ is closed to new replies.