• Hi!

    First, thanks for this great plugin, it is always my go-to solution for customizing the login pages!

    I’m working on a project where we have the usual /login/ page, but we also show the login form on article pages for non-logged users. Like a paywall. So, this is what happens right now:

    1) Non logged user goes to article page.
    2) Non logged user sees the login form. Then he tries to submit the form with his credentials.
    3) If he enters any incorrect information, like the password, he is redirected to the /login/ page. But there are no error messages on this page.
    4) If they try to submit the login form on the /login/ page, with incorrect credentials again, then the error message shows up properly.

    I’m using the same shortcode both on the /login/ page and on article pages ([theme-my-login instance=1]). I tried both with “instance=1” and without it.

    Am I doing something wrong? Is there a way to “sync” the article page with the login page and show the error messages properly?

    Thanks for any help!

Viewing 5 replies - 1 through 5 (of 5 total)
  • Plugin Author Jeff Farthing

    (@jfarthing84)

    Maybe try instance="1"?

    Thread Starter Diego de Oliveira

    (@diegoliv)

    Hi, Jeff!

    Tried that, but it didn’t work. So I’m trying a different approach. Instead of “syncing” the login forms, I just want that the login form on the article page doesn’t redirect to /login/. So this is how it should work:

    1) User goes to article page.
    2) User sees the paywall with the login form. User fills the form and submits.
    3) If username / password is incorrect, reload the article page with proper error messages.
    4) If username / password is correct, log in the user and reload the article page.

    So, I tried, on the article page, using the shortcode, with or without the instance parameter. Also tried adding the TML widget. Now the login form stays on the article page when username / password is incorrect, but none error messages are displayed. On the /login/ page, error are properly displayed. What am I doing wrong?

    Thread Starter Diego de Oliveira

    (@diegoliv)

    An update: I made a quick test. On the article page, I replaced the [theme-my-login] shortcode with a default wp_login_form() function. This function rendered the default WP login form on the article page. When I submitted the form, I was redirected to the /login/ page, BUT on this case, the error message was properly displayed (like I was trying to achieve at the beginning). So, basically, using wp_login_form() works (redirects to /login/ page, with proper error messages), but using [theme-my-login] shortcode or widget doesn’t (redirects to /login/ page, but doesn’t show any error messages).

    Plugin Author Jeff Farthing

    (@jfarthing84)

    Is you login page the same one that TML created?

    Thread Starter Diego de Oliveira

    (@diegoliv)

    Jeff, yes, it is. mysite.com/login/ is the page that TML created, and also the page that the default instance of the [theme-my-login] shortcode is placed. Then, on all posts, when the user is logged in, I tried, like I explained above, adding both [theme-my-login] shortcode and wp_login_form(). only wp_login_form() sent me to the /login/ page showing the error messages correctly. [theme-my-login] sends me to the /login/ page, but without error messages.

Viewing 5 replies - 1 through 5 (of 5 total)
  • The topic ‘Login Form on multiple pages + error message handling’ is closed to new replies.