- This topic has 2 replies, 2 voices, and was last updated 8 years, 2 months ago by .
Viewing 3 posts - 1 through 3 (of 3 total)
Viewing 3 posts - 1 through 3 (of 3 total)
- You must be logged in to reply to this topic.
WordPress Membership Plugin
Simple Membership Plugin › Forums › Simple Membership Plugin › Display logged-in user's name
I want to display the logged-in user’s name and info on the front-end and I dont know how to make this work.
I already have the code below in my functions.php but I dont know how to display it on the front-end OR which hook to use:
// Get user name
function user_details() {
$user_id = SwpmMemberUtils::get_logged_in_members_id();
$fname = SwpmMemberUtils::get_member_field_by_id($user_id, 'first_name');
$lname = SwpmMemberUtils::get_member_field_by_id($user_id, 'last_name');
$user_name = $fname . ' ' . $lname;
return $user_name;
}
thanks
I want to display the logged-in user’s name and info on the front-end and I dont know how to make this work.
Can you do this using shortcodes instead?
https://simple-membership-plugin.com/simple-membership-addon-show-member-info/
I have marked this thread as “Resolved”. I HAVE BEEN ABLE TO MAKE IT WORK.