-
Henry Wright replied to the topic [Resolved]How to redirect registration page to activity? in the forum How-to & Troubleshooting 9 years, 11 months ago
@bphelp thanks for testing 🙂
@tatakatte yeah, it’s likely something in your installation is already redirecting. The priority just makes sure
my_login_redirect()
is executed first. -
bp-help replied to the topic [Resolved]How to redirect registration page to activity? in the forum How-to & Troubleshooting 9 years, 11 months ago
@tatakatte
Did you make sure you set your registration page as a static page in dashboard/settings/reading because I just tested it and it works as expected. On my dev environment when I go to the site without being logged in it redirects me to the registration page. Once I log in it redirects to the activity stream. Isn’t that what you…[Read more] -
bp-help replied to the topic [Resolved]How to redirect registration page to activity? in the forum How-to & Troubleshooting 9 years, 11 months ago
@tatakatte
Did you make sure you set your registration page as a static page in dashboard/settings/reading because I just tested it and it works as expected. On my dev environment when I go to the site without being logged in it redirects me to the registration page. Once I log in it redirects to the activity stream. Isn’t that what you wanted? -
bp-help replied to the topic [Resolved]How to redirect registration page to activity? in the forum How-to & Troubleshooting 9 years, 11 months ago
@tatakatte
Maybe your slug is wrong in the URL. Try this:
function my_login_redirect() {
if ( is_user_logged_in() && bp_is_register_page() )
bp_core_redirect( home_url() . '/activity/' );
}
add_action( 'template_redirect', 'my_login_redirect' );
Reason being you may have changed the pages name but if you didn’t change the slug as…[Read more]
-
bp-help replied to the topic [Resolved]How to redirect registration page to activity? in the forum How-to & Troubleshooting 9 years, 11 months ago
@tatakatte
Should work fine in the themes functions.php as @henrywright specified or in bp-custom.php -
bp-help replied to the topic [Resolved]How to redirect registration page to activity? in the forum How-to & Troubleshooting 9 years, 11 months ago
@tatakatte
Did you put Henry’s code in with opening and closing php tags? Make sure there is no white space between the opening and closing php tags as this will give an headers already sent error. -
Henry Wright replied to the topic [Resolved]How to redirect registration page to activity? in the forum How-to & Troubleshooting 9 years, 11 months ago
Hi @tatakatte
Try this:
function my_login_redirect() {
if ( is_user_logged_in() && bp_is_register_page() )
bp_core_redirect( home_url() . '/stream/' );
}
add_action( 'template_redirect', 'my_login_redirect' );
@tatakatte
Active 9 years, 11 months ago