I’m trying to display a greeting on the homepage.
Either Hello Guess, would you like to register or login?
or If logged in, Hello $name
I’ve been looking through codex, and tried, $current_user, wp_get_current_user and a few others, all of which do nothing.
Now I know the problem (I think)
I’m not including a file that contains these functions!
Problem is, I can’t figure out which one.
I would Ideally like to display the username
so if logged in
Hello, USERNAME. (or other user)
If not. Hello Guest.
Could someone please point me in the right direction as far as picking which function will display the USERNAME best and what file its in, that i need to include to make it work. I’m using a custom theme, but its based off Twenty Ten and as for as the included files go, I haven’t changed any inside header.php.
(I have the if logged in code already)
- The topic ‘Display Greeting’ is closed to new replies.