Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Register Page as Homepage redirect issue

  • Avatar of tse11
    tse11
    Participant

    @tse11

    I have decided to use the registration page as my homepage and the only issue I am running into is now, when logged in users try to access my site’s main page they are being redirected to the member’s directory. I would like them to be redirected somewhere else. Any help would be soooo appreciated. Thanks.

    I’m using BuddyPress 1.8 and WordPress 3.6- multisite

    PS- I do not want a plugin to redirect Buddypress members upon log in, I just need to find the place where I can edit the default redirection when a LOGGED IN member tries to access my homepage/registration page.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Avatar of @mercime
    @mercime
    Keymaster

    @mercime

    Avatar of Henry
    Henry
    Participant

    @henrywright-1

    @tse11

    I came across this exact same thing a few weeks back so wrote the function below:

    // redirect front page for logged in visitors
    function redirect_front_page_for_loggedin_users() {
    	global $bp;
    	// redirect only when user is logged in and we are viewing the front page as set in WP admin
    	if ( is_user_logged_in() && ( is_front_page() ) ) {
    		wp_redirect( $bp->loggedin_user->domain );
    		exit();
    	}
    }
    add_action( 'wp', 'redirect_front_page_for_loggedin_users' );
    Avatar of tse11
    tse11
    Participant

    @tse11

    Thanks very much, @henrywright-1 that was exactly what I needed, worked like a treat ;)

Viewing 3 replies - 1 through 3 (of 3 total)

You must be logged in to reply to this topic.