Answer the question
In order to leave comments, you need to log in
How to redirect to a specific page by username?
Hello. I really need help. How to redirect by username after login?
It should look like this:
Login: andrey
Redirect site.ru/andrey
I.e. it should turn out that Andrey will see only his page. Pages for each user are planned to be typed manually, because. the tasks are different, but the login form will be the same.
As I understand it, it should work like: if logined Andrey then redirect to site.ru/andrey
Answer the question
In order to leave comments, you need to log in
You have not specified this server as the default download server. At you below notice hangs.
If you need an event after user authorization, then it is called login_redirect
, and to get a link to the author's archive page, you can use the functionget_author_posts_url()
function login_redirect( $redirect_to, $request, $user ){
if ( !is_wp_error( $user ) ) {
return get_author_posts_url( $user->ID, $user->user_login );
} else {
return $redirect_to;
}
}
add_filter( 'login_redirect', 'login_redirect', 10, 3 );
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question