Hi,
I would like to restrict access to every course page and to the forums. If a non-logged in user click on the link, it would redirect them to the login page.
Thank you
Hi,
You can try using the site lock feature in this case, as you do not want the non logged in users to see the courses, refer:
https://vibethemes.com/documentation/wplms/knowledge-base/site-lock-in-wplms/
Hi,
I still want the visitors to be able to visit every other page of the website.
Hi,
Well there is no such setting for this, but for restricting the users from forums, you can create all the forums as private.
For courses is it only the single course page that you want to hide ?
If yes then I can give you a custom code to redirect non logged in users to homepage when accessing the single course page .
Let me know if you want it.
Hi,
I will set them as private then, thank you.
I would like the single course to be hidden, as the page with all-courses.
Thank you
Hi,
Do you want to redirect single course page to all courses page for non logged in users ?
Hi,
I don't want non logged in users to be able to access all courses page and single course page.
Hi,
Add the bellow code in your wplms-customizer.php file present in your wplms customizer plugin:
add_action('template_redirect',function(){
if( !is_user_logged_in() && (bp_current_component() == 'course' || is_singular('course')) ){
wp_redirect(home_url());
exit();
}
},1);
This will redirect non logged in users to the homepage when they try to access the all courses page or the single course page.
Hi,
thank you very much. It works. :)