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]
Hi,
I’m sorry for being impatient. My apologies. I didn’t mean to offend. I will not cross post again.
Regards
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
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
Where you want it to appear. You mentioned the sidebar. That would be the sidebar.php file in your theme.
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
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
The other also should work if you change currentuserdata => currentuserinfo.
I don’t use any of them, just checked out now 🙂