1

I'm building an application for a client that is accessed via an email address and a project number - a custom field.

I created a really simple form from scratch (i.e. not using wp_login_form), and I validate the posted values with WP_QUERY.

My problem is that when the form values are incorrect, or blank, the user is being automatically redirected to the wp-login.php page.

How can I override this behavior and keep the user on the custom log-in page template?

    <form action="<?php the_permalink(); ?>" method="post">
        <label for="form_email">Email Address:</label>
            <input id="form_email" type="text" name="email" value="" />
        </label>
        <label for="form_project">Project Number:</label>
            <input id="form_project" type="text" name="project" value="" />
        </label>
        <input type="submit" name="submit" value="Submit" />
    </form>
0

This has been covered quite thoroughly here:

https://wordpress.stackexchange.com/a/105224/62906

I've linked directly to the most informative and complete answer of the group (IMO).

| improve this answer | |
  • The question you linked to (like almost all that I read prior to posting my question) deals with overriding the default behavior of the wp_login_form() function, which I'm not using. Any idea if the processes outlined there would still be valid? – MarketHubb Oct 3 '15 at 23:10
  • Yes, only part of the answer I highlighted deals with the wp_login_form() helper. The hooks and custom helpers defined in that answer modify other aspects of the process which are not specific to the native login form. – dswebsme Oct 4 '15 at 3:12
0

If you want to customize it through coding then this tutorial is surely gonna help you. You can easily replace default WordPress login page with your own custom login page.

http://www.inkthemes.com/how-to-redirecting-wordpress-default-login-into-a-custom-login-page/

| improve this answer | |

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.