Skip to:
Content
Pages
Categories
Search
Top
Bottom

[Resolved] Register Page as Homepage redirect issue

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

  • @mercime
    Moderator

    @mercime


    Henry
    Member

    @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' );

    tse11
    Participant

    @tse11

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


    vanleurth
    Participant

    @vanleurth

    Henry,

    Thank you so much for the script. Works like a charm !! 🙂 5 Stars

    V.

Viewing 4 replies - 1 through 4 (of 4 total)
  • The topic ‘[Resolved] Register Page as Homepage redirect issue’ is closed to new replies.
Skip to toolbar