In my Multisite Installation i get the user id with:
$user_ID
and it works fine in my subsite (subdomain). My users can only log in from the mainsite and i didnt figure out how to get the username when the user is logged in and visits the subsite (subdomain) But the User ID works fine…
I need the name of the user? Any way to filter the name out of the user ID – so i get the name of the user instead of the user id number?
Thank you so much
Try the
get_user_by(...)
Function, that returns a WP_User instance that you can then use to extract the User Name.So you would call it like so
You can also try the
wp_get_current_user
function (click here ) that return details about the currently logged in user, including the full name.