Tips and Tricks HQ Forum

Support Forum for Tips and Tricks HQ Products

Register or log in - lost password? (Having an issue with the forum login?)

Search the Forum

Tips and Tricks HQ Forum » WP eMember » WP eMember Troubleshooting

How to echo emember login name?

(2 posts) (2 voices)
  • Started 2 years ago by gymgangsta
  • Latest reply from amin007
  • Possible Solutions (Related Topics):
    1. eMember - Mailchimp first name and second names not being transferred
    2. eMember - No error messages appearing on failed login
    3. WP eMember - Creating or Customizing the Compact Login Widget/Links
    4. eMember login button "jumps" cursor down to eStore form field in the sidebar

Tags:

  • echo user_name
  • emember login name
  1. gymgangsta
    Member

    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!

    Posted 2 years ago #
  2. amin007
    Key Master

    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');

    Posted 2 years ago #

RSS feed for this topic

Reply

You must log in to post.

Tips and Tricks HQ  | WP Shopping Cart  | WP Affiliate Software  | WordPress Membership Plugin