Support » Fixing WordPress » Show only if logged into password protected page?

  • Ok… So I am using the following code to show something only if the page is password protected…

        if ( !post_password_required() ) {
                echo 'protected stuff';

    The problem is that if I use that code in a place in my template it shows up on all pages using that same template when I’m logged into one of the password protected pages…even if the page I’m viewing isn’t password protected. make sense?

    Is there a way to also check if the page you are on is password protected? That way the specific protected stuff is only shown on that page? I don’t remember this being an issue in the past, so I’m not sure if it is a new bug or something where the cookie stored isn’t page specific.

    I can’t figure out why it isn’t working so that things only show on the specific password protected page rather than all of them using that template when logged into one of them.

    Thanks in advance.

Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
  • The topic ‘Show only if logged into password protected page?’ is closed to new replies.