将 Wordpress 的登录/注册页面重定向到自定义登录/注册页面 [英] Redirecting Wordpress's Login/Register page to a custom login/registration page

查看:27
本文介绍了将 Wordpress 的登录/注册页面重定向到自定义登录/注册页面的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个网站,有一个用户系统.我想将 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.

有没有办法做到这一点?我试过谷歌,但我能找到的只是用户登录或注册后的重定向,这不是我想要的.

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屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆