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,
For single pages you could just edit single.php
and add something along the lines of:
<?php
if ( is_user_logged_in() ) {
// Show Post to Logged in User
}
else {
//Show password field
}
?>
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
or archive.php