Paste this into your functions.php file and edit according to comments.
add_filter('login_redirect', 'redirect_user', 10);
function redirect_user(){
global $user;
//where you want to redirect users too
$redirect = home_url() . '/where-do-we-go-from-here/';
/*
* each role listed in this array will be redirect to above URL
* if you only have one user role to redirect then simply remove
* the others.
*/
$role = array(
'subscriber',
'another_role',
'etc'
);
if ( in_array( $user->roles[0], array( 'administrator') ) ) {
//admin will go to the dashboard
return admin_url();
} elseif ( in_array( $user->roles[0], $role ) ) {
return $redirect;
}
}
I should add that the following,
$redirect = home_url() . '/where-do-we-go-from-here/';
//returns http://www.example.com/where-do-we-go-from-here/
Can also be written as,
$redirect = home_url( '/where-do-we-go-from-here/' );
//returns http://www.example.com/where-do-we-go-from-here/
…where by the function home_url
accepts the path as one of its arguments/parameters.