Here is a great article that explains one solution to do what you are trying to do that I’ve personally used. http://justintadlock.com/archives/2012/10/16/how-i-run-a-membership-site
In your case you’ll want to customize the th3_club_member_template
function to something like this:
add_filter( 'template_redirect', 'nifty_log_in_check', 99 );
function nifty_log_in_check( $template ) {
if ( is_page('clients_only' ) ) && !current_user_can( 'view_client_content' ) ) //change this to suite your needs
{
wp_redirect( home_url() );
exit();
}
}
You can then use theme my login to set up the login form.
Once the user logs in you can either manually redirect them or use a plugin like Peters Login Redirect
To manually redirect them you can do something like this:
function nifty_login_redirect( $redirect_to, $request, $user ){
//is there a user to check?
global $user;
if( isset( $user->roles ) && is_array( $user->roles ) ) {
//check for admins
if( in_array( "administrator", $user->roles ) ) {
// redirect them to the default place
return $redirect_to;
} else {
return home_url().'/client-area'; //change this
}
}
else {
return $redirect_to;
}
}
add_filter("login_redirect", "nifty_login_redirect", 10, 3);