If User Logged In WordPress

if ( is_user_logged_in() ) {
 // your code for logged in user
} else {
 // your code for logged out user
}

Leave a Comment