I need help with wordpress. I will show a login box on my main page and if some registered user logs in, I want to show some links/navigation to that person only (not to guests). Is that possible? If yes then how? Please guide me with.
Thanks
Use the conditional check is_user_logged_in()
:
if( is_user_logged_in() ){
// The user is logged in
} else {
// They're not logged in
}
This will work any time after the 'init' hook.
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.