How do I force a login?
I tried doing things like the below example
/* If not logged in, the user will be redirected to the registration/login page */
if ( !is_user_logged_in() ) :
$destination = site_url( BP_REGISTER_SLUG . ‘/’ );
wp_redirect( $destination, 302 );
index.php as normal
but I ran into this error message every time:
Warning: Cannot modify header information – headers already sent by (output started at C:xampplitehtdocswp-contentthemespartyhookupsindex.php:4) in C:xampplitehtdocswp-includespluggable.php on line 890
Any ideas on how to force a redirect to register.php if I’m not allowed to touch the headers?
- The topic ‘How do I force a login?’ is closed to new replies.