Tag Info

New answers tagged

1

Here is the function to redirect non-users to login page. function redirect_user() { if ( ! is_user_logged_in() && ! is_page( 'login' ) ) { $return_url = esc_url( home_url( '/login/' ) ); wp_redirect( $return_url ); exit; } } add_action( 'template_redirect', 'redirect_user' );



Top 50 recent answers are included