• Resolved roseau

    (@roseau)


    Have been trying for a few days now. If anyone can help it would be amazing. Firstly the Force Login plugin is fab. It does exactly what it says. My issue is I want heaven and earth and I don’t have the skills. I want to use it to login to a new login form, say called new_login. Also I wish to have one exception, the landing page which would have a link to the login page. That page is straight forward.
    This is the starting code I have, but I don’t know how to modify it. Just know it is appended to the functions file.


    // Custom Login URL function my_login_page( $login_url, $redirect ) { return site_url( ‘/custom-login/?redirect_to=’ . $redirect ); } add_filter( ‘login_url’, ‘my_login_page’, 10, 2 );

    If anyone could help? thank you

    Paul

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

    (@kevinvess)

    Hi– thanks for using Force Login!

    First, you’ll need the following example script to bypass Force Login and make an exception for your landing page:

    /**
     * Bypass Force Login to allow for exceptions.
     *
     * @param bool $bypass Whether to disable Force Login. Default false.
     * @return bool
     */
    function my_forcelogin_bypass( $bypass ) {
    
      // Allow 'My Landing Page' to be publicly accessible
      if ( is_page('landing-page') ) {
        $bypass = true;
      }
    
      return $bypass;
    }
    add_filter( 'v_forcelogin_bypass', 'my_forcelogin_bypass' );

    Set the 'landing-page' string in is_page() to be your landing page slug or ID.

    The rest of my advice is outside the scope of this plugin. I recommend you hire a developer to help you customize this for you.

    Next, you may use the login_url filter to change what page WordPress links to for the login URL. The code example you shared should work, just set the site_url() to the custom login page you want.

    Good luck!

    Thread Starter roseau

    (@roseau)

    Stylish, thank you very much.

    Paul

Viewing 2 replies - 1 through 2 (of 2 total)
  • The topic ‘Noobie Help with modification’ is closed to new replies.