Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Redirecting Wordpress's Login/Register page to a custom login/registration page

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.

Thank you in advance.

like image 376
Bruno De Barros Avatar asked Dec 29 '09 20:12

Bruno De Barros


1 Answers

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();
 }
}
like image 192
nickohrn Avatar answered Oct 17 '22 08:10

nickohrn