One Password Form For All Password Protected WordPress Posts

When using a custom post type for portfolio items, I needed several of them to be password protected, showing a lock icon instead of the portfolio item. The posts are shown via a normal loop, but they’re just thumbnails with lightbox links. To password protect them all, and have them all unlock with a single method, I came up with the following:

For the above to work, all posts passwords need to be the same password. The above uses featherlight, or whatever lightbox you prefer to hide/reveal the password form. Remove the display:none from #passwordInput to bypass lightbox.

Leave a Reply