How to implement a custom password field that redirects to another page?
-
I have a password protected page (Page X), but I need the password form that grants access to Page X to live on the home page.
With the password form on the home page, I want the user to be able to enter the correct password directly. If correct, I want the user to be redirected to the password protected Page X.
Is this possible to implement? Normally, once a user presses on a link that is password protected, they are redirected to the password form that is its own separate page. But I want to cut out this intermediary password form page, and place the form directly on the home page. If you have any tips, please let me know.
I tried using the get_the_password_form function below (from wp-includes folder) and passing in the page/post ID. It does return the proper HTML code for a form, and a form is displayed. However, it does not function correctly: does nothing despite entering in the correct password.
The page I need help with: [log in to see the link]
- The topic ‘How to implement a custom password field that redirects to another page?’ is closed to new replies.