Skip to:
Content
Pages
Categories
Search
Top
Bottom

Login page

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

  • Venutius
    Moderator

    @venutius

    Could id be caused by a plugin incompatibility?


    Gerdule1
    Participant

    @gerdule1

    Might be, I have no idea why is this happening and how to fix it


    Rimon Habib
    Participant

    @rimon_habib

    If you want to redirect all users(admin,subscriber,all roles) to homepage after login, just use this line at your theme functions.php file
    add_filter( 'login_redirect', create_function( '$url,$query,$user', 'return home_url();' ), 30, 3 );

    Or if you filter a bit, like Admin users will redirected to dashboard, and all others to home page, you can place this code instead of that

    function wp_bp_custom_login_redirect( $redirect_to, $request, $user ) {
    	global $user;
    	if ( isset( $user->roles ) && is_array( $user->roles ) ) {
    		if ( in_array( 'administrator', $user->roles ) ) {
    			return $redirect_to;
    		} else {
    			return home_url();
    		}
    	} else {
    		return $redirect_to;
    	}
    }
    
    add_filter( 'login_redirect', 'wp_bp_custom_login_redirect', 30, 3 );
Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Login page’ is closed to new replies.
Skip to toolbar