Show different pages on site depending on user choice

Some commenters mentioned using $_SESSION to solve the issue, and to save a variable there (i.e. “visitor_type”) to use it in showing pages.

This would work, but it’s often discouraged to use $_SESSION in WordPress, reasons can be read here.

However, I’ve also been in a situation where you can’t avoid using $_SESSION.

What I would do, and please correct me someone if this is not a good solution, is to have 3 different menus, and by default use the menu that is shown to all visitors. Once the visitor clicks “Company” or “Individual”, the page just refreshes with a $_GET variable set to “Company” or “Individual”.

In the code where you call the menu, you can check $_GET for that value and load a different menu. A really simple solution could look like this:

if(isset($_SESSION["visitor_type"])){
wp_nav_menu( array( 'theme_location' => 'primary'.$_SESSION["visitor_type"] );
}
elseif(isset($_GET["visitor_type"]){
$_SESSION["visitor_type"] = $_GET["visitor_type"];
wp_nav_menu( array( 'theme_location' => 'primary'.$_GET["visitor_type"] );
}
else{
wp_nav_menu( array( 'theme_location' => 'primary_generic' );
}

Now it’s up to you to intelligently handle $_SESSION complications, like if you want to allow visitors to switch type etc…

Good luck.

Edit: As I was writing this, someone mentioned Cookies. Some reading on them is available here.