You can separate your users with roles, with different capabilities, and you can add custom roles to your theme. Use the capabilities of the users to filter the content you show them with the WP functions current_user_can()
and is_user_logged_in()
. Here you have an example:
if(is_user_logged_in() && current_user_can( 'read' )){
// Show something
}else{
if(is_user_logged_in()){
// Show something else
}else{
// Redirect to login?
}
}
You can also filter access to pages depending of the user itself and not the role. It’s too much specific in my opinion, but it could be an option. The function wp_get_current_user() would retrieve you the current user in the page, and you could compare it with your known user. With this option you can also get the exact role of the user and filter them with that, which I think is a better option.