Is there anyway of checking if a password protected post is visible / not visible? I want some thing that says this;

If the post is password protected (that parts fine) and the correct password hasn't been entered, then show 'XXX', else show 'ZZZ'.


post_password_required(): whether post requires password and correct password has been provided.

if ( post_password_required() ) {
     echo 'xxx';
} else {
     echo 'zzz';
|improve this answer|||||

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.