• Skip to primary navigation
  • Skip to main content
  • Skip to primary sidebar

WP SITES

2662

Original Genesis Tutorials & 5000+ Guaranteed Code

Snippets

  • Support
  • Newsletter
  • Videos
  • Log in

Premium Member? - Request custom code

Add Custom Class To Style Private Password Protected Posts

This PHP code generates a new custom class you can use to style all your password protected posts.

Add the class to your child themes style.css file and begin styling your password protected posts.

More Ways To Style Protected Posts

.password-protected .entry-content input {
	width: 50%;
}

.password-protected .entry-content input[type="submit"] {
        width: 20%;
}

This sample CSS simply aligns the password form inline so the submit button displays next to the input field on password protected posts only.

From this:

default form

To this:

password protected form

Remove Protected Text Before Title

This PHP code removes the Protected text before the entry title added to password protected posts.

Related Code Snippets

  • Show Password Protected Content To Logged In Users

Reader Interactions

Leave a Reply Cancel reply

You must be logged in to post a comment.

Primary Sidebar

PHP Code

template_include

get_body_class

if else

array

class_exists

foreach

sprintf

add_action

printf

variable

Advertise · WPEngine · Genesis · Log in

  • How Premium Membership Works
  • Sign Up
  • Support
  • Subscription Details/Invoice
  • Tagged Tutorials
  • Access-Download Problems