@sofoort
5 years, 5 months ago
//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’ );
This code works, but now I can’t see the profile page. Every time I try I’ll get redirected to the register page. Even when I am logged in.
Can someone help me solve this?