Title: [Plugin: Private WP] Edit so that front page is displayed to non-loggedin users?
Last modified: August 20, 2016

---

# [Plugin: Private WP] Edit so that front page is displayed to non-loggedin users?

 *  [SoItBegins](https://wordpress.org/support/users/soitbegins/)
 * (@soitbegins)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-private-wp/)
 * I am using the plugin Private WP, whose sole purpose is to keep non-logged-in
   users out of your blog. I want to modify it to show the home page, but allow 
   access to no other part of the site if you’re not logged in.
 * Here is the entire code of the plugin:
 *     ```
       <?php
       function private_wp() {
         if (!is_user_logged_in()) {
           auth_redirect();
         }
       }
   
       add_action('get_header', 'private_wp');
       ?>
       ```
   
 * I tried changing `if (!is_user_logged_in())` to `if (!is_user_logged_in() && !
   is_front_page())`, but it didn’t work. Does anyone have any idea as to the nature
   of the problem?

Viewing 1 replies (of 1 total)

 *  Moderator [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * (@bcworkz)
 * [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-private-wp/#post-2971567)
 * I have no idea. I added the noted plugin code to my generic testing plugin on
   my xampp test server, including your change, and it works perfectly. Nothing 
   wrong with your change, the problem lies elsewhere.

Viewing 1 replies (of 1 total)

The topic ‘[Plugin: Private WP] Edit so that front page is displayed to non-loggedin
users?’ is closed to new replies.

 * In: [Hacks](https://wordpress.org/support/forum/plugins-and-hacks/hacks/)
 * 1 reply
 * 2 participants
 * Last reply from: [bcworkz](https://wordpress.org/support/users/bcworkz/)
 * Last activity: [13 years, 7 months ago](https://wordpress.org/support/topic/plugin-private-wp/#post-2971567)
 * Status: not resolved

## Topics

### Topics with no replies

### Non-support topics

### Resolved topics

### Unresolved topics

### All topics
