- This topic has 1 reply, 2 voices, and was last updated 14 years, 9 months ago by .
Viewing 2 posts - 1 through 2 (of 2 total)
Viewing 2 posts - 1 through 2 (of 2 total)
- You must be logged in to reply to this topic.
Support site for Tips and Tricks HQ premium products
by
Tips and Tricks HQ Support Portal › Forums › WP eMember › WP eMember Troubleshooting › How to echo emember login name?
Tagged: echo user_name, emember login name
I would like to echo the wp emember login name
I am using this code:
<?php echo $user_name = $current_user->login_user_name; ?>
and it seems to work when I login as admin only, It does not appear when someone has joined. Could you be so kind as to tell me what is correct in displaying the username? I’ve tried almost all of them emember_user_name, emember_login_name etc etc…
cheers and many thanks for your great support!
Use this to retrieve the currently logged in users info:
<?php
global $auth;
$user_name = $auth->getUserInfo('user_name');
echo $user_name
?>
You can retrieve the User ID with the following line of code:
$user_id = $auth->getUserInfo(‘member_id’);