Hello Simon,
The Pro version of Profile Builder allows access to the Custom Redirects module which allows you to set different types of redirects, including redirects to the default WordPress login/register/lost password pages.
But you can achieve the default WordPress pages redirects with the following code:
function wppbc_free_default_login_redirect() {
$login_page = 'LOGIN_PAGE_URL';
$register_page ='REGISTER_PAGE_URL';
$password_recovery_page = 'PASSWORD_RECOVERY_PAGE_URL';
$page = basename($_SERVER['REQUEST_URI']);
if( $page == "wp-login.php" && $_SERVER['REQUEST_METHOD'] == 'GET') {
wp_redirect($login_page);
exit;
}
else if ($page == "wp-login.php?action=register") {
wp_redirect($register_page);
exit;
}
else if ($page == "wp-login.php?action=lostpassword") {
wp_redirect($password_recovery_page);
exit;
}
}
add_action('init','wppbc_free_default_login_redirect');
Please add the URLs to your login, register and lost password pages in the first 3 variables at the top of the code.
Instructions on how to use this code can be found at the top of this page.
Best Regards,
Thread Starter
51m0n
(@51m0n)
Thank you Georgian.
Much appreciated. I will see how I get on. I may move on the pro version if testing goes well.
Regards
Simon
21/12/16
Thread Starter
51m0n
(@51m0n)
Sorry one more thing. I’m assuming this code goes in the functions.php file for my theme. Right?
S
Hello Simon,
Either that or check the instructions found at the top of this page.
Best Regards,