// Redirect to login page in wordpress
add_action( 'init', 'ej_wp_user_logged_in' );
function ej_wp_user_logged_in() {
if (!is_user_logged_in()) {
wp_redirect( wp_login_url() ); exit;
}
}
Previous Article
Remove the word WordPress from the title of the WordPress admin panel
Next Article