Created
June 19, 2014 15:54
-
-
Save Pross/4dbf4b2ee8b74ccc47ac to your computer and use it in GitHub Desktop.
Add a class to passworded post
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
add_filter( 'body_class', 'add_password_class' ); | |
function password_class( $classes ) { | |
if( post_password_required() ) { | |
$classes[] = 'password-required'; | |
} | |
return $classes; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment