I'm trying to show different homepages based on the user role. I have 4 differents pages:
Home - Default one Home 1 - User role 1 Home 2 - User role 2 Home 3 - User role 3
The problem i have right now is to show the pages for the user roles.
This is the function i'm using for check the user role.
function get_user_role(){
if (is_user_logged_in()) {
global $current_user;
$user_roles = $current_user->roles;
$user_role = array_shift($user_roles);
return $user_role;
}else{
return "subscriber";
}
}
Also i'm showing the page called "Home" to show on homepage using in the page.php
is_front_page()
But.. How can i show the other pages instead of the default front page?
Thanks in advance