• Resolved vdarita

    (@vdarita)


    Hi, FORCE LOGIN worked great restricting all pages.

    I have no experience with programming, and I just don’t know how to whitelist or exclude the homepage since whitelisting needs to have an absolute link.

    sample:
    need to whitelist domain.com/
    and restrict all other pages including domain.com/?s=

    looking for a walkthrough guide.

    thank you for the assistance.

Viewing 3 replies - 1 through 3 (of 3 total)
  • Plugin Author Kevin Vess

    (@kevinvess)

    Hi– thanks for using Force Login!

    I recommend you use the v_forcelogin_bypass filter to bypass Force Login using the WordPress Conditional Tag.

    Add something like this to your themes functions.php file:

    /**
     * Bypass Force Login to allow for exceptions.
     *
     * @return bool Whether to disable Force Login. Default false.
     */
    function my_forcelogin_bypass( $bypass ) {
      if ( is_front_page() || is_search() ) {
        $bypass = true;
      }
      return $bypass;
    }
    add_filter('v_forcelogin_bypass', 'my_forcelogin_bypass', 10, 1);
    Thread Starter vdarita

    (@vdarita)

    its working, thank you!

    Plugin Author Kevin Vess

    (@kevinvess)

    Excellent!

    Be sure to rate and review my plugin to let others know how you like it.

    Thanks for using Force Login!

Viewing 3 replies - 1 through 3 (of 3 total)
  • The topic ‘Whitelist Homepage only’ is closed to new replies.