WordPress.org

Ready to get started?Download WordPress

Forums

Changing to login page as default (4 posts)

  1. dguaraldi
    Member
    Posted 6 years ago #

    Hello, I am trying to make the Login Page the default page when I go to WP. Right now when I go to WP, it goes to the blog page and I want to make it the login page because I don’t want anyone to see anything unless they log-in.
    I tried messing with IIS and the index.php page but no luck,
    Any help would be appreciated.
    Thanks.

  2. haochi
    Member
    Posted 6 years ago #

    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.

  3. dguaraldi
    Member
    Posted 6 years ago #

    Hi haochi, I did as you suggested.
    I placed <?php if(!is_user_logged_in()){header("Location: http://WP/wp-login.php");} ?>
    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.

  4. dguaraldi
    Member
    Posted 6 years ago #

    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……

Topic Closed

This topic has been closed to new replies.

About this Topic