Super Plugin Sale! Your Choice: BOGO or 30% Off »
Web Dev + WordPress + Security

Customize Password-Protected Posts

To customize WordPress-powered password-protected posts, follow these simple steps.

Step 1

First open template-functions-post.php and find the function get_the_password_form(), which is located near the top of the page.

There are several aspects of this function that you may wish to customize. For example, the Perishable Press website requires several CSS attributes for stylistic control. Thus we simply added the class postpassword to the form input field, as well as the class passwordsubmit to the form submit button. This enabled full stylistic control over password-protected posts. You may also wish to modify the size of the input text field, or even edit the submit-button text.

Step 2

Finally, remember to check both the post comment view for proper “password message” display. If it is not, edit the local comments.php file (usually near the top) until the message displays correctly.

About the Author
Jeff Starr = Designer. Developer. Producer. Writer. Editor. Etc.
GA Pro: Add Google Analytics to WordPress like a pro.
Welcome
Perishable Press is operated by Jeff Starr, a professional web developer and book author with two decades of experience. Here you will find posts about web development, WordPress, security, and more »
Digging Into WordPress: Take your WordPress skills to the next level.
Thoughts
All free plugins updated and ready for WP 6.6 dropping next week. Pro plugin updates in the works also complete :)
99% of video thumbnail/previews are pure cringe. Goofy faces = Clickbait.
RIP ICQ
Crazy that we’re almost halfway thru 2024.
I live right next door to the absolute loudest car in town. And the owner loves to drive it.
8G Firewall now out of beta testing, ready for use on production sites.
It's all about that ad revenue baby.
Newsletter
Get news, updates, deals & tips via email.
Email kept private. Easy unsubscribe anytime.