开发者

Changing Location of user Login Page in WordPress

开发者 https://www.devze.com 2023-01-03 09:29 出处:网络
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 h

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]

0

精彩评论

暂无评论...
验证码 换一张
取 消