NooTheme Premium WordPress Theme › Forums › JobMonster › Redirect users to another page after Login or Register
Tagged: redirect login register
- This topic has 9 replies, 2 voices, and was last updated 5 years, 2 months ago by
dangdv.
-
AuthorPosts
-
5 years, 3 months ago #1205688
1. How can I redirect users to another page url after they login and after they register? . I would like to redirect candidates to one page url and employers to another page url both after login and after register. How can I do this?
for example:
If user is a candidate redirect to https://example.com/page1
If user is an employer redirect to https://example.com/page2
5 years, 3 months ago #1205748Dear, if you want do it, please install and switch your site to use Jobmonster Child theme. then add custom code to file functions.php of child theme.
Redirect after login:
add_filter( 'login_redirect', function($redirecturl, $user_signon){ if(Noo_Member::is_employer($user_signon->ID)){ $redirecturl = 'https://example.com/page2'; // Employer }elseif (Noo_Member::is_candidate($user_signon->ID)){ $redirecturl = 'https://example.com/page1'; //Candidate } return $redirecturl; },10,2);Redirect after Employer register
add_filter('noo_register_redirect_employer', function($redirect_to){ $redirect_to = 'https://example.com/page2'; return $redirect_to; })Redirect after Candidate register
add_filter('noo_register_redirect_candidate', function($redirect_to){ $redirect_to = 'https://example.com/page1'; return $redirect_to; })Best regards.
5 years, 3 months ago #1205847This reply has been marked as private.5 years, 3 months ago #1205935Dear, i custom code is missing ';' (see attachment) please check custom code on your site again.
Best regards.
5 years, 2 months ago #1206172This reply has been marked as private.5 years, 2 months ago #1206215Dear, please kindly send for me admin account and your site URL via private reply, i will check details to help you.
Best regards.
5 years, 2 months ago #1206273This reply has been marked as private.5 years, 2 months ago #1206339This reply has been marked as private.5 years, 2 months ago #1206368That is exactly what I want. After register or login I would like to redirect to the URL shown in the above attached screenshot or to any other external URL. For your testing purposes, you may use any external URL. The problem is that the code you sent me doesn't take me to the URL indicated but instead it keeps redirecting to Noo's theme default URL. So for some reason it is not working.
5 years, 2 months ago #1206406This reply has been marked as private. -
AuthorPosts
You must be logged in and have valid license to reply to this topic.
