1) Only paste this code snippet in your child theme's function.php.
add_action('template_redirect','hide_course_from_visitor'); function hide_course_from_visitor(){ if (!is_user_logged_in()){ wp_redirect(home_url(),'302'); } }
Modified on: Tue, Jun 16, 2015 at 6:52 PM
1) Only paste this code snippet in your child theme's function.php.
add_action('template_redirect','hide_course_from_visitor'); function hide_course_from_visitor(){ if (!is_user_logged_in()){ wp_redirect(home_url(),'302'); } }
Did you find it helpful? Yes No
Send feedback