-
Author
-
June 27, 2018 at 21:44 #202191
hamsar
ParticipantHi again,
I m using a snippet which blogs non members to access certain pages. However its also blocking blog posts. I did allow the blog page however its not accessible to non members. Thanks
Thanks
AB
June 27, 2018 at 21:46 #202192hamsar
ParticipantHi again,
I m using a snippet which blocks non members to access certain pages. However its also blocking blog posts. I did allow the blog page, however blog posts are not accessible to non members.
Thanks
AB
June 27, 2018 at 22:08 #202200hamsar
Participantis there a snippet where i can allow blog post to be viewed and indexed. thanks
June 28, 2018 at 02:30 #202225Laura
ModeratorHello, it depends, if your plugin also blocks them to be indexed you won’t be able to index them.
Have you tried paid membership pro? It let’s you individually block posts for certain user levels but they are indexedHi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJune 28, 2018 at 02:45 #202230hamsar
ParticipantHi LAURA,
I m using this snippet and its blocking the post to be viewed by non logged users. But I want to allow 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’);June 28, 2018 at 22:35 #202343Laura
ModeratorHello, replace it with this and let me know if it works
COPY CODE/* Restrict guests only to those pages.*/ function sq7R_kleo_restrictions_guest_restrict() { $allowedpages= array(‘register’,’activate’,’Home’,’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’);Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solutionJune 28, 2018 at 23:49 #202368hamsar
ParticipantHi ,
It works but now its not redirecting users to the registration page rather they are redirected to the membership level page. I want non logged to be redirected to the registration page. thanks
Thanks
June 29, 2018 at 22:57 #202424Laura
ModeratorHello, if you block blogs they will be redirected but you don’t want to block blogs so they are able to see it and not be redirected. It’s one thing or the other
Hi there!!! Help others from the community and mark any reply as solution if it solved your question. Mark as a solution -
AuthorPosts
You must be logged in to reply to this topic.