[Resolved] Redirect users to Registration other wise set Activity as front page
-
I’ve tried the following to redirect users to Registration page if not logged in and to the Activity page if logged in.
In WordPress, I set the “Front page:” to Activity (Activity is a WordPress Page that is set to Activity Streams in the BP Page settings tab)
In my theme’s functions.php file, I’ve added:
add_action( 'init', 'redirect_visitors' ); function redirect_visitors() { if ( !is_user_logged_in() && !bp_is_register_page()) { wp_redirect( 'http://www.mysite.org/my-site-registration' ); exit; } }
However, when
wp_redirect( 'http://www.mysite.org/my-site-registration' )
is run. There is a redirect loop on the registration page.I was led to doing it this way because if I set the WordPress Front page: to the page I have set as the registration page, the site redirects the visitor to the Members page once logged in. I haven’t found a way to change this to be anything other than the Members page.
IN SUMMARY: I would like a user who visits the homepage of my site to see the Registration Page. I would like uses, once they are logged in, or already logged in, to see the Activity Stream as the front page.
- The topic ‘[Resolved] Redirect users to Registration other wise set Activity as front page’ is closed to new replies.