I have a page that is password protected, and I wish to removed some parts of the theme, and add others. Can I do that? Is there a check I can do in the theme files to see if a user has entered the password or not?


Just use the post_password_required() conditional:

if ( post_password_required() ) {
    // Post is password-protected; do something
} else {
    // Post is NOT password-protected; do something else

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.