Redirect to different ‘Home’ page based on User Role

[ad_1]

I’m working on a site where different companies will be logging into our site to view their assigned content. Each company has a different home page that is branded for their business. Each user is assigned a User Role based on their company name. After login, users are redirected to their specific company homepage. That all works great.

What I want to do is create a ‘Home’ button in the main menu that redirects to the specific company home page, but have that redirect based on user role.

So the main menu would have a link to /home

If someone assigned the ‘company-1’ role clicked on that home button, they would be redirected to /home-company-1

If someone assigned the ‘company-2’ role click on that home button, they would be redirected to /home-company-2

I’m currently using Ultimate Member and have found that I can create different ‘Home’ menus linked to each company page and set the User Role to show/hide that link in the menu. This is working fine. However, once we have 25 companies logging into our site, I don’t want to have to manage 25 different links in the menu—assigning which company goes to what ‘Home’ button.

So my question is…

Is there a way to redirect a static URL (such as /home), and have that URL redirect to specific pages based on the User Role of the person logged in?

[ad_2]

 

This site will teach you how to build a WordPress website for beginners. We will cover everything from installing WordPress to adding pages, posts, and images to your site. You will learn how to customize your site with themes and plugins, as well as how to market your site online.

Buy WordPress Transfer