Login redirect

7.17K viewsGeneral
1

after users login it goes to /wp-admin which is restricted

0

Hi Kumar,

THank you very much for your answer. I try but nothing change. Maybe i forget someting. I add this to the function.php page (sahifa theme). To explain better, i would like to redirect my user when their want “Sign Up” to my specific page “register”, no to wp-login.php.

i get always a redirect to :  http://www.mywebsite.com/wp-login.php?action=register

Sorry i’m very beginner and also my english is not so good

Cordially Philippe

0

Hi Rahul,

Sorry to disturb you, i’m not really expert. I try to add you code on my function.php theme. I use Sahifa and TwelveTweety theme, but noting change. Maybe i do something wrong. Did i need to change the red color link on your code ?

I really appreciate your help.

Cordially Philippe

Replace add_filter(‘login_redirect’, ‘my_redirect_to_ap_base_page’); with add_filter(‘login_redirect’, ‘my_redirect_to_ap_base_page’, 1);

1

Add this hook:

function my_redirect_to_ap_base_page() {
  return ap_base_page_link();
}

add_filter('login_redirect', 'my_redirect_to_ap_base_page');

In any file is added to that?

Thank you, Rahul!

theme functions.php

How would the function look like if I would like to redirect the user to the home page and not the base page?

I made a functions.php file in my child theme & entered the hook

now i get page distortion & login doesn’t work

@chris Please chnage ap_base_page_link() to home_url(‘/’).
@Tarrence This hook has nothing to do with styles unless there is something missing. Please give us gist link to your functions.php

Many thanks Kumar.

@Tarrence, its look like you have added your code before <?php tag. Please add it at the end of file.

I added tag to child theme thanks