Hi,
I m using this snippet and its blocking the post to be viewed by non logged users. But I want to allow blog post to be viewed by non logged users. How can i make it happen. Thanks
/* Restrict guests only to those pages.*/
function sq7R_kleo_restrictions_guest_restrict() {
$allowedpages= array(‘register’,’activate’,’Home’,’blog’,’reasons-to-join’,’privacy-policy’,’about-us’,’terms-of-service’,’contact’);
if( !is_user_logged_in() && !is_page($allowedpages)) {
wp_redirect(site_url( ‘/register’) );
}
}
add_action(‘template_redirect’, ‘sq7R_kleo_restrictions_guest_restrict’);