Wordpress - redirect if you\'re not logged in

/ Published in: PHP
Save to your folder(s)

Add this in the functions.php file, in your Wordpress theme.

Copy this code and paste it in your HTML
  1. if(!is_user_logged_in() && $pagenow != 'wp-login.php') {
  2. wp_redirect( '/comingsoon.html', 302 );
  3. }

Report this snippet


RSS Icon Subscribe to comments

You need to login to post a comment.