Modify wordpress plugin free website background landing address

The use of open source, modify the site background landing address security have a certain role for the protection of the site. Wordpress website for the program, modify the background landing address the option of using Protected wp-login plugin can also be achieved by a few simple lines of code, the following method step through code implementation.

Add the following code to the theme functions.php file first line of code <?phpbelow:

1
2
3
4
5
6
add_action('login_enqueue_scripts','login_protection');  
function login_protection(){  
    	if($_GET['login'] != 'admin'){
		wp_redirect(get_bloginfo('url'));
	}  
}

Once saved, we must use http://域名/wp-login.php?login=adminwill automatically jump to the site home page into the background when the login screen, and access the original landing address.

Guess you like

Origin www.cnblogs.com/ttyytyuyu/p/11961134.html