Hi
Try
$current_user = wp_get_current_user();
$current_user=$current_user->user_login;
All the best !
Thanks for your help but it doesn’t work.
The strangest thing is that in the homepage it works perfectly, but when I go on the user profile from ultimate member it’s doesn’t. I haven’t had any problem with this plugin and I try to deactivated every plugin and to use a normal theme, but still happen.
Anyone please ?
Thanks again
Hi
You should have mentioned you’re using the Ultimate Member plugin.
//This will retrieve the current profile user ID in Ultimate Member
$profile_id = um_profile_id();
If you want to display other User info , like the current user login
$user_info = get_userdata($profile_id);
$user_login_name=$user_info->user_login;
echo $user_login_name;
All the best!
Hi again,
If you want to retrieve the data of the logged in user
um_user(‘ID’); can be used instead of um_profile_id();
Let me know if this works for you π
You may also want to read up and experiment with um_user(); as I am sure there’s a nifty way to call up the user’s info.
it should be um_user($key);
Perhaps someone with more UM experience can chime in π
THanks for the answer, I reinstal everything and it’s working, I don’t what’s happen.
Thank a lot again
J