<?php 

/**
 * Make this sit private
 */

function make_this_site_private() {

    if ( ! is_user_logged_in() && $GLOBALS['pagenow'] !== 'wp-login.php' ){
        
        wp_redirect( wp_login_url( $wp -> request ) );
        
        exit;
    
    }

}

add_action( 'wp', 'make_this_site_private' );

/**
 * After succesful login, 
 * redirect to homepage
 */

function admin_default_page() {
    return '/';
}

add_filter( 'login_redirect', 'admin_default_page' );