wordpress set two login pages

<?php
//if you want to show two (different) login pages for two (different) links,
//you can first of all think of two urls for two different login pages.
//here, i have two links =>  /login-old  and  /login-new for which i want different forms,
//now as any of these url hits the browser, i will check for url paramenter 

	$url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];

	if (strpos($url,'login-new') !== false) {
	    // echo 'to New Login page';
	    $cookie_name = "login_page";
		$cookie_value = "new";
		setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); //will not set immediately, but useful later for logout
    	header("Location: ".site_url('login'));  //this will be your default  login page url
		exit;
      
	} else if(strpos($url,'login-old') !== false) {
    	// echo 'to Old Login page';
	    $cookie_name = "login_page";
		$cookie_value = "old";
		setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); //will not set immediately, but useful later for logout
    	header("Location: ".site_url('login'));  
		exit;
    }

//now that the cookie is set, i know which form to show to user,   
//now, as the user gets redirected to default login page, go to it's template file
//and check for the default login form, where, check,

$login_page = '';
if (isset($_COOKIE['login_page'])) {
	$login_page = $_COOKIE['login_page'];
}

if ($login_page == 'new') {  ?>
  <style>
  #your new form styling here...
  </style>
<?php } else if ($login_page == 'old'){ ?>
  <style>
  #your old form styling here...
  </style>
<?php }

if ($login_page == 'new') { ?>
  <form id="new_form" action="" method="post"> </form>
<?php } else if ($login_page == 'old'){ ?>
  <form id="old_form" action="" method="post"> </form>
<?php } 
//here, check the default login form action attr to put above in our custom forms 
 

Are there any code examples left?
Create a Free Account
Unlock the power of data and AI by diving into Python, ChatGPT, SQL, Power BI, and beyond.
Sign up
Develop soft skills on BrainApps
Complete the IQ Test
Relative searches
two step wp login page multiple login restriction in wordpress can two people login to wordpress same login for multiple sites wordpress wordpress can 2 people use the same login at same time use same log in with 2 wordpress websites share login between multiple site wordpress how to create multiple login forms for free in wordpress how to create two login forms in wordpress one login in to two different wordpress one login in to two different wordpress user can i add multiple wp_login actions in wordpress how to make multiple login in wordpress how to connect two wordpress site login together how to create two login for company and customer on a wordpress website 2 wordpress sites one login wordpress theme to contact multiple login users at the same time wordpress is taking to login page create custom user login page wordpress - custom login page customize login screen wordpress wordpress page edit after login page customize wordpress login page for members login in page and backend wordpress for custom wordpress customized login form custom login systes How to make your own login how to add login field in home page how to make changes to thim login form wordpress create login page wp home page on login differenet login for subscriber wordpress login page wordpress how to install login plugin in wordpress wordpress login system how to create login in wordpress login page with additional login wordpress like login page design wordpress likelogin page design wordpress login template wordpress update login page custom login page wp custom login page login form page template woocommerce wordpress location of login page to customize wordpress login sample page worpress login html coopy wordpress login setting completely customise login page with image without plugins login page your website wordpress override login page change login template wordpress style login use wp login.php file as template login system php same as wordpress customize wp admin login page login page php log in system for wordpress how to create a custom login page html only how to create a custom login page html not wordpress custom admin login wordpress code php login page wordpress how to make a login page in wordpress login page wp modifying wordpress login method custom wordpress login Create a Custom Login Page login style cancel rom load wordpress custom login login code and actions wp wordpress login tutorial wordpress customize login page wordpress development custom login wordpress custom authentication wordpress login form code from scratch how to create custom login and registration page in wordpress integrate wp login function on a wp template page integrate wp login function on a teplatte design admin login page in wordpress by programmatically wordpress login page fit with theme wordpress change login page custom wordpress login page admin custom login wordpress using code how to create a Login page in wordpress wordpress login page customize login system in wordpress wp user login customize wordpress login screen with youzer login page wordpress template woocommerce create custom login form. wordpress blog with login module customize wordpress sign in page wp custom login wordpress customise login page login wordpress custom page customize your wordpress login page wordpress blog with login theme wordpress login page add email user section how to create page login instead of wordpress admin make wordpress login from code wordpress login page without code wordpress login page custm login functionality in wordpress wordpress custom login page wordpress login page wordpress how to make a login page wordpress login form design add action after setup theme custom login wp login wordpress website login, registration and auth in wordpress without plugin wordpress custom login customize login page wp login requred page and set selected login page plugin in wordpress wp create custom login php wordpress login source code change wordpress login page design set link to open page change wordpress login page design customize wordpress login page custom login pagewordpress custom login page wordpress authentification page in wordpress customize login theme wordpress wordpress login page for users how to make login system for its employees plugin login page in wordpress woocommerce change login page change wordpress agent login wordpress branded login how to use wordpress login for all logins how to create a wordpress login page plugin to build login page on wordpress site plugin to build login page on wordpress plugin build login page on wodpress plugin make login page on wodpress plugin create login page on wodpress plugin to create login page for wordpress beautiful example of login page in wordress exemeple of login page in wordress how do you create a login logout registration and authentication with wordpress how to add login authentication to a wordpress website induvial and corporate login in wordpress how to add login page in wordpress create new login page wordpress wordpress create new login page wp custom login page make your own login open a different page on wp login logged page user wordpress login customizer funcions.php popup wordpress 10 post admin login page custom login registration wordpress design how to make wordpress website login register page Php code login page wordpress website how to change wordpress login page design using bootsrap wordpress /user-login/ page customize login page wordpress how to make seperate login page for wordpress admin and public user wp dev custom login page wordpress login template page wp login template wordpress set two login pages
Made with love
This website uses cookies to make IQCode work for you. By using this site, you agree to our cookie policy

Welcome Back!

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign in
Recover lost password
Or log in with

Create a Free Account

Sign up to unlock all of IQCode features:
  • Test your skills and track progress
  • Engage in comprehensive interactive courses
  • Commit to daily skill-enhancing challenges
  • Solve practical, real-world issues
  • Share your insights and learnings
Create an account
Sign up
Or sign up with
By signing up, you agree to the Terms and Conditions and Privacy Policy. You also agree to receive product-related marketing emails from IQCode, which you can unsubscribe from at any time.
Creating a new code example
Code snippet title
Source