将Wordpress的“登录/注册"页面重定向到自定义登录/注册页面 [英] Redirecting Wordpress's Login/Register page to a custom login/registration page
问题描述
我有一个网站和一个用户系统.我想将wordpress的用户系统集成到该网站的用户系统中,但是我仍然想使用该网站的注册/登录页面.我不希望任何人都能使用Wordpress的登录或注册表格进行登录或注册.相反,当他们尝试访问Wordpress中的登录/注册页面时,我希望这些页面将它们重定向到我自己的登录/注册页面.
I have a website, with a user system. I want to integrate wordpress's user system into that website's, but I still want to use the website's register/login pages. I don't want anybody to be able to login or register using Wordpress's login or registration forms. Instead, when they're try to access the login/registration pages in Wordpress, I want those pages to redirect them to my own login/registration pages.
有什么办法吗?我已经尝试过Google,但是我所能找到的只是在用户登录或注册后进行重定向,这不是我想要的.
Is there any way of doing this? I've tried Google, but all I could find was redirection AFTER the user logs in or registers, which is not what I want.
谢谢.
推荐答案
为此,您需要将登录/注册页面重定向到您的自定义页面.
因此,将此代码写入激活的主题文件夹下的functions.php
文件中.将自定义页面路径作为参数传递.
For this you need to redirect login/registration page to your custom pages.
So, Write this code in your functions.php
file Under your activated theme folder. Pass your custom page path as a Argument.
add_action('init','possibly_redirect');
function possibly_redirect(){
global $pagenow;
if( 'wp-login.php' == $pagenow ) {
wp_redirect('http://google.com/');
exit();
}
}
这篇关于将Wordpress的“登录/注册"页面重定向到自定义登录/注册页面的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!