@silsbyc
5 years, 2 months ago
sofoort,
Try adding another pair of parenthesis to the if statement
if( ! is_user_logged_in() && (is_page( ‘members’ )|| is_page( ‘activity’ ) || bp_is_user()) )
Full code: //Hide for non-logged-in users (public visitors) function bp_logged_out_page_template_redirect() { if( ! is_user_logged_in() && (is_page( 'members' )|| is_page( 'activity' ) || bp_is_user()) ) { wp_redirect( home_url( '/register/' ) ); exit(); } } add_action( 'template_redirect', 'bp_logged_out_page_template_redirect' );
//Hide for non-logged-in users (public visitors) function bp_logged_out_page_template_redirect() { if( ! is_user_logged_in() && (is_page( 'members' )|| is_page( 'activity' ) || bp_is_user()) ) { wp_redirect( home_url( '/register/' ) ); exit(); } } add_action( 'template_redirect', 'bp_logged_out_page_template_redirect' );