Custom login page redirect
-
Hi
I have a custom login page made in wordpress. I do not want to show wp-admin page, instead I would like users to access the custom page I made.
I tried the below code that I found everywhere on the internet but it doesn’t work. $page_viewed never satisfies the condition. I am getting this is $page_viewed –
wp-login.php?redirect_to=http%3A%2F%2Flocalhost%2F{siename}%2Fwp-admin%2F&reauth=1
function my_redirect_login_page() { $login_page = home_url( '/login/' ); $page_viewed = basename($_SERVER['REQUEST_URI']); if( $page_viewed == "wp-login.php" && $_SERVER['REQUEST_METHOD'] == 'GET') { wp_redirect($login_page); exit; } } add_action('init','my_redirect_login_page');
Can any one please help me out here.
Thanks.
Viewing 3 replies - 1 through 3 (of 3 total)
Viewing 3 replies - 1 through 3 (of 3 total)
- The topic ‘Custom login page redirect’ is closed to new replies.