Using navigation menu link for real time login logout but it is working like wordpress login and I want it to work like front end user login as I created pages for login.
I am using another plugin to get login and sign up page for the users and use navigation menu link plugin to get real time login, logout at the menu bar.
The issue is it is working as wordpress login not like front end user login so how to get it work like user login and it should use my login and sign up pages that I have created apart from wordpress default login screen
Firstly, you have to signup the user as Subscriber type. And then force user to redirect on the front-end pages after login. You have to make the users forcefully redirect on the custom login page and signup page. Use the below code as required in the functions.php.
<?php
/** Funtion to redirect user after logout*/
add_action(’wp_logout’,’go_home’);
function go_home(){
wp_redirect( home_url() );
exit();
}
/**Function to redirect vistors to custom register page from `wp-login.php?action=register`
*/
add_action( ’login_form_register’, ’wpse45134_catch_register’ );
function wpse45134_catch_register()
{
wp_redirect( home_url( ’/sign-up’ ) );
exit(); // always call `exit()` after `wp_redirect`
}
/**Function to redirect lostpasword button from wp-admin page to custom reset page password*/
function change_lost_password_link(){
$LostPassURL = home_url(’/reset-password’);
return $LostPassURL;
}
add_filter(’lostpassword_url’,’change_lost_password_link’);
/**Function to redirect user to custom page after login on the site*/
function admin_default_page() {
return home_url(’/packages’);
}
add_filter(’login_redirect’, ’admin_default_page’); ?>
Kindly let me know where to put this code
You have to add this code in the functions.php
Resolved