Buddypress registration page redirection loop errors after adding if(!is_user_lo
-
I’m running wpms install with buddypress (wp 3.9, из 1.9)
I’m using code below to make main website protected from not logged in users, and let them to visit only landingpage, registration and activation pages. Registration and activation pages are native buddypress pages.
<?php function shield() { if( !is_user_logged_in() ) { if( !is_page( array( 'landingpage', 'registration', 'activation')) ) { wp_redirect( 'landingpage' ); exit(); } } } add_filter('get_header','shield',1); ?>
Code works perfectly. Except that it ends to redirection loop errors on registration and activation pages….
I think it’s because buddypress has similar functions for this kind of pages for logged in users – to redirect them away from those two.
How to fix it? I would like to protect part of the site. But let registration.
PS: To prevent questions about login – it’s on landingpage.
- The topic ‘Buddypress registration page redirection loop errors after adding if(!is_user_lo’ is closed to new replies.