Support » Fixing WordPress » Changing to login page as default

Viewing 3 replies - 1 through 3 (of 3 total)
  • Use is_user_logged_in()
    Put this in the header.php file of your theme, at the very top of the file:
    <?php if(!is_user_logged_in()){header("Location: http://WP/wp-login.php");} ?>

    Not tested.

    Thread Starter dguaraldi

    (@dguaraldi)

    Hi haochi, I did as you suggested.
    I placed <?php if(!is_user_logged_in()){header(“Location: http://WP/wp-login.php&#8221;);} ?>
    at the very top of the header.php file but I cant even get to WP after that.
    Would you or anyone else have any suggestions?
    Thanks.

    Thread Starter dguaraldi

    (@dguaraldi)

    Never mind, I got it to work. I had to change the http:// statement to mach my IIS setup (duh me) Works like a champ, thanks much, you’re a hero……

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Changing to login page as default’ is closed to new replies.