• I have a custom page template which forces a login if not currently logged in.
    It uses the PHP header() function, as in:

    header(“Location: /wp-login.php”);

    But this bypasses SimpleModal Login.
    How can I invoke the modal login from PHP?

Viewing 1 replies (of 1 total)
  • Plugin Author Eric

    (@emartin24)

    @flymike – since SimpleModal Login is a client-side modal, you are going to have to find a creative “work around” to make this work.

    There are a number of different options, but here’s one that might be the easiest to implement:

    Place this JavaScript in your theme:

    <script>
    jQuery(function ($) {
        if(window.location.hash === "#login") {
            $('.simplemodal-login').trigger('click.simplemodal-login');
        }
    });
    </script>

    Update your redirect to include the login hash:

    header("Location: /index.php#login");

    Hope that helps.

    -Eric

Viewing 1 replies (of 1 total)
  • The topic ‘[Plugin: SimpleModal Login] howto invoke the modal login directly from PHP’ is closed to new replies.