Is there an easy way to password protect an archive and single posts of a custom post type?
I found this article on password protecting single posts, but am still lost on the archive loop. I would want it only display the password box until the user has logged in.
Thanks,
The only way I’ve found to quickly password-protect the archive is by creating a template that retrieves the custom post type data and associating it with a page that can be password protected.
http://codex.wordpress.org/Page_Templates
Once that page is password protected, you find the post ID to apply it to the single-{your_custom_post_type}.php like so:
This saves you from having to password-protect every post under your custom post type.
For single pages you could just edit
single.php
and add something along the lines of:If like you mentioned you are using a custom post type or an archive template you could apply the same method as above to
single-[custom-post-type-name].php
orarchive.php