Password Protect Custom Post Type does not work

When editing a custom post, it gives me the option to change the visibility to password-protected - exactly the same options as with posts/pages. However, when I set a password and launch the custom post page, it loads it completely without the need to enter the password. It also doesn’t ask for a password when loading the custom post page using Chrome Incognito or other browsers.
This was a feature I use a lot with pages and it’s frustrating it is not working with custom posts. With Pages, it asks for the password before the page opens and with normal posts, the password form is under the featured image. Am I missing anything?

Hello @innovatek,

Thanks for writing in! Are you using a custom Single layout for your custom post type? You may need to use the “The Content” element in displaying the custom post-type item contents because this is where the password field should appear. We would love to investigate your issue. You can create a secure note in your next reply with the following info:
– Link to your site
– WP login URL
– WP username
– WP password
– WP Administrator Role
– Confirmation that we can access and make changes to your site

To know how to create a secure note, please check this out: How The Forum Works

image

Best Regards.

Thanks for the quick follow-up.
I’m using a custom single layout. It is a technical layout with a lot of custom fields being inserted in different elements (headers, text, shortcodes, tabs, tab labels, video embeds, conditional visibility within certain elements, ACF repeaters, styling, etc). No way to include all of this in the ‘The Content’ element without stripping out a lot.
There are at least three options:

  1. If I enabled Guterburg for these custom posts and inserted the ‘template’ within that and ACF merge tags, would that then be pulled in with formatting using the "The Content’ element in the custom post single payout?

  2. The other way would be to insert a password form within the page that, on successful submission, adds reference data to the page URL. I can then set the elements to only display when the right reference is attached to URL. I could make a landing page for the password form, but want to keep everything contained within the custom post for simple replication.

  3. Use an external password custom post plugin or technical PHP snippet. No free plugin does this for custom posts and I want to keep things simple.

Any other suggestions?

Hello @innovatek,

At the moment, your only option is #1. At the moment, there is no other way to detect if the current page, post, or any custom post item has a password or not. I already added a feature request on this so that we can have an element condition that detects the password.

Thank you for your understanding.

Thanks. I decided to use a form (Fluent Forms) on the page to input and check the password against a ACF password field. This worked until I hit another issue.
Apparently, a script I use for my embedded subsciption form (Transpond - a similar service to MailChimp) is disrupting the loading of the Fluent Form. It makes it initially load with no styling and all hidden fields showing, before it reloads correctly after a secod. The subscription form script is in the header. Is there a way to delay the loading of that particlaur script va a PHP code snippet?
I have a test page and will include this and the script in a secure note.
Thanks

Hey @innovatek,

We’re glad that you’re able to find an alternative option. On the the other hand, providing or enhancing the code for delaying the execution is outside the scope of our theme support. You may seek 3rd party developers to help you with your problems or you can avail One where we can answer questions outside of the features of our theme.

If you know how JS works, you can delay the javascript execution by using the settitmeout function.

Hope that helps and thank you for understanding.

This topic was automatically closed 10 days after the last reply. New replies are no longer allowed.