wordpress set two login pages

Solutions on MaxInterview for wordpress set two login pages by the best coders in the world

showing results for - "wordpress set two login pages"
Lisa
31 Jun 2020
1<?php
2//if you want to show two (different) login pages for two (different) links,
3//you can first of all think of two urls for two different login pages.
4//here, i have two links =>  /login-old  and  /login-new for which i want different forms,
5//now as any of these url hits the browser, i will check for url paramenter 
6
7	$url = 'http://' . $_SERVER['SERVER_NAME'] . $_SERVER['REQUEST_URI'];
8
9	if (strpos($url,'login-new') !== false) {
10	    // echo 'to New Login page';
11	    $cookie_name = "login_page";
12		$cookie_value = "new";
13		setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); //will not set immediately, but useful later for logout
14    	header("Location: ".site_url('login'));  //this will be your default  login page url
15		exit;
16      
17	} else if(strpos($url,'login-old') !== false) {
18    	// echo 'to Old Login page';
19	    $cookie_name = "login_page";
20		$cookie_value = "old";
21		setcookie($cookie_name, $cookie_value, time() + (86400 * 30), "/"); //will not set immediately, but useful later for logout
22    	header("Location: ".site_url('login'));  
23		exit;
24    }
25
26//now that the cookie is set, i know which form to show to user,   
27//now, as the user gets redirected to default login page, go to it's template file
28//and check for the default login form, where, check,
29
30$login_page = '';
31if (isset($_COOKIE['login_page'])) {
32	$login_page = $_COOKIE['login_page'];
33}
34
35if ($login_page == 'new') {  ?>
36  <style>
37  #your new form styling here...
38  </style>
39<?php } else if ($login_page == 'old'){ ?>
40  <style>
41  #your old form styling here...
42  </style>
43<?php }
44
45if ($login_page == 'new') { ?>
46  <form id="new_form" action="" method="post"> </form>
47<?php } else if ($login_page == 'old'){ ?>
48  <form id="old_form" action="" method="post"> </form>
49<?php } 
50//here, check the default login form action attr to put above in our custom forms 
51 
queries leading to this page
wp function set detault login url to my custom login urlwordpress set two login url linkshow to find the login url for wordpress sitewordpress change login pagewordpress admin login urlwordpress change login to my accountchange login urlswitch wordpress site to login pagechange wp login urlwordpress set two login pageswordpress change wp login urlwordpress custom login urlchange wp login urlwordpress find login urlhow to follow the permalink in wordpress after the login pagewordpress change login urlhow to make wordpress login default pagehow to chnage login page link in eoocommercechange default login page wordpresswordpress plugin change login urlcustom login url wordpresswordpress login page chagehow to change the wordpress login urlwp login urlhow t change wp login urlmultiple login attemps wordpress what to dowordpress change default login ruhow to merge login using get method in wordpresswordpress find admin url cmdlinemodify wp login urlchanged the wp login to another url can 27t rememberhow to logged two wordpress website with same loginhow to get a wordpress login urlwordpress set login url to a buttonhow to change url when someone logs in in wordpresscustome link for loginchange wordpress login pagewordpress where is the login pagewp rewrite login page urlwordpress login urlhow to find the wordpress login pagechange the login page wordpress urlhow to change wordpress login urlwp password page url loginwordpress different login urlwp login page changedchange sign up link wordpresswordpress set referer urlwordpress set two login urlcustom wp login urlwordpress admin login locationhow to change the login form on wordpresswordpress change login destinationchange wordpress login urlchange login url in wordpressinurl 3a login panelhow to change wp login url in wordpresschange wordpress default login urlchange wp admin login urlcustom login page wp urlwp rewrite url rout for login pagewordpress sigle login to multiple websitewordpress multiple login urls pages phpwordpress change the default wp login urlwp admin login urlwordpress login in one site to anotherwordpress move login screenlogin url change wordpresshow to find nonstandard wordpress login pagewordpress sign in from urllogin urlwordpress set two login pages