i want to setup a different homepage for logged in users .
now what we have is a same static home page for both guest and signed in users . but i want this home page different for signedout user and signin users .
because signed out user will see the homepage designed for sales
and signed in user must have different home page specific for their account
(after sign in the user must not see the old sales homepage even when clicked on home , it must redirect to the different page ,what we set )
Add the below code in your wp-admin->plugins->editor->select wplms customizer plugin and add the code in the wplms-customizer.php file:
add_action('template_redirect','custom_redirect_to_different_homepage',9999);
function custom_redirect_to_different_homepage(){
if(is_user_logged_in() && is_front_page()){
wp_redirect('http://www.vibethemes.com');
exit;
}
}
NOTE: Change the vibethemes.com to your custom home page for logged in users.
even guest can visit the second page but copying the url
how to prevent guest from accessing the page meant for logged in users
Edit the page and set the page template as members only.
Let me know if this helps.
i want to make the dashboard as the homepage for logged in user . how to do it
Add the bellow code and remove the previous code:
add_action('template_redirect','custom_redirect_to_different_homepage',9999);
function custom_redirect_to_different_homepage(){
if(is_user_logged_in() && is_front_page() && defined( 'WPLMS_DASHBOARD_SLUG' )){
wp_redirect(bp_loggedin_user_domain().WPLMS_DASHBOARD_SLUG);
exit;
}
}