[Plugin: Private WP] Edit so that front page is displayed to non-loggedin users? (2 posts)

  1. SoItBegins
    Posted 3 years ago #

    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:

    function private_wp() {
      if (!is_user_logged_in()) {
    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?

  2. bcworkz
    Posted 3 years ago #

    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.

Topic Closed

This topic has been closed to new replies.

About this Topic


No tags yet.