Take the 2-minute tour ×
WordPress Development Stack Exchange is a question and answer site for WordPress developers and administrators. It's 100% free, no registration required.

I have set a page to be password protected in the admin, but for some reason WP is not asking for the password when viewing the page.

It definitely isn't a plugin as I have confirmed the behaviour with the plugin folder renamed. I have been testing it in Chrome w/incognito.

The page is using a custom template, which may be the problem? No other templates I have looked at though seem to display any password logic.

share|improve this question
    
Maybe you already have the password stored within cookies? –  onetrickpony Aug 5 '11 at 13:28
1  
Either you entered the password once before and forgot, or your custom template isn't set up to handle password protected content. It will be easier to diagnose if we could see the code to your custom template. Please post it here. –  EAMann Aug 5 '11 at 13:31
    
The template is assisting a very complex plugin, the content of the post isn't actually loaded as it doesn't contain the loop. In incognito mode there are no cookies passed. –  Dunhamzzz Aug 5 '11 at 13:44
    
@EAMann is the pasword logic required in the template? Or is it activated in the loop as that would explain it –  Dunhamzzz Aug 5 '11 at 13:59
    
@EAMann, you don't have to add any checks in custom template for this. WP will do this automatically. –  Steven Aug 5 '11 at 15:52
show 1 more comment

1 Answer

up vote 1 down vote accepted

The answer to this question was simply that the built-in password protection does not apply if you are using a custom template that doesn't include the_loop(). Lesson learnt.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

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