Changing Location of user Login Page in WordPress
I have a login form setup for my WordPress site,开发者_运维知识库 but when a user types in the wrong user/pass it directs them to the WP login screen. Is there any way that I can change this without hacking WPMU core?
You will have to use below filter to change the login url.
add_filter('login_url','wdm_login_url',10,2);
function wdm_login_url($login_url, $redirect)
{
$login_url = home_url().'/your-page-slug/';
return $login_url;
}
So every time, request goes to wp login screen, it will get redirected to your page
You should use a plugin. A search for "login" on WP Plugins can be helpful, maybe check out this plugin.
you can make the login form (wp-login.php), redirect them back by providing a hidden input text name 'redirect_to' in form that you have written. by using 'redirect_to', Wordpress understand that you want after login user will send to the link
forexample :
[pre]http://xxx.xxx/wp-login.php?redirect_to='http://xxx.xxx' [pre]
加载中,请稍侯......
精彩评论