WordPress.org

Support

Support » How-To and Troubleshooting » [Resolved] how to say ‘howdy, $user_id’

[Resolved] how to say ‘howdy, $user_id’

  • Basically I’d like to duplicate the Admin panel functionality. If someone is logged, I’d like them to see a “Hello, $user_id” where $user_id is their nickname.

    I looked through the Template Tags but don’t see anything that will do it — anyone point me the right way? 🙂

Viewing 15 replies - 1 through 15 (of 22 total)
  • Hi,

    I think this should work:

    <?php printf(__('Hello, <strong>%s</strong>.'), $user_identity) ?>

    (piked it straight off the wp-admin/admin-header.php)

    Kat, the Twat

    Unfortunately $user_identity isn’t defined outside of wp-admin :-/

    global $user_identity;
    get_currentuserdata();
    if ($user_identity) { echo "Hi $user_identity!"; }

    Oh good, with this info I should be able to stop my own blog admin pages from saying “howdy” to me….. WHAT a silly thing to have implemented…. nice for the OP, the global one though!

    Hey, I like WordPress’ folksy welcome. Don’t see what’s wrong here…

    Each to her own…. I know who I am, I don’t need some program saying hello to me to remind me….

    I don’t need some program saying hello to me to remind me….

    Considering I have 6 different logins on a couple setups, yeah it helps to be reminded.

    Her? ;)

    I’m a her. She. Whatever…. each to “hisser” own (to rob a word from Jo Clayton….)

    danke mucho for the help 🙂

    Geez, V, can’t ya go anywhere without starting an argument? And all because your user admin is trying to be FRIENDLY! sheesh!

    Hmph. There are better ways of being friendly…. besides, I was just happy to have someone point out where to find the silly thing.

    There was an argument? And I missed it? While being in the middle of it?

    Man, I’m good.

    I TOLD you you were good the other day…. you missed that too huh?

    *snicker*

    No, I just didn’t believe it. After all, the word is you’re always starting arguments, so…

    *rolls eyes* Well, you just can’t believe everything you hear (*whispers* especially if it’s kickass saying it….)

    *virtuously wearing halo* I only start arguments when there’s a 100% chance of either: A. winning; or B. annoying someone important beyond the point of no return.

Viewing 15 replies - 1 through 15 (of 22 total)
  • The topic ‘[Resolved] how to say ‘howdy, $user_id’’ is closed to new replies.