[Resolved] Redirect if user is already logged in
-
I am trying to redirect users that have already logged in to a different page if they go to my main/home page on my site using this code:
function bp_help_redirect_to_profile(){
global $bp;if( is_user_logged_in() && bp_is_front_page() )
bp_core_redirect( get_option(‘home’) . ‘/members/’ . bp_core_get_username( bp_loggedin_user_id() ) . ‘/profile’ );}
add_action( ‘get_header’, ‘bp_help_redirect_to_profile’,1);
As the code is now, it sends logged in users trying to get to the front page to their member page, but I would like to change this. I have replaced
bp_core_redirect( get_option(‘home’) . ‘/members/’ . bp_core_get_username( bp_loggedin_user_id() ) . ‘/profile’ )
with
bp_core_redirect( get_option(‘home’) . ‘/new’)
but get an error every time
If someone could point me in the right direction as how to direct logged in users to mysite.com/new instead of their member profile, that would be greatly appreciated, thanks in advance!
- The topic ‘[Resolved] Redirect if user is already logged in’ is closed to new replies.