dguaraldi
Member
Posted 4 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.
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.
dguaraldi
Member
Posted 4 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.
dguaraldi
Member
Posted 4 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……