最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

bug - Password Protected page not asking for a password

programmeradmin2浏览0评论

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.

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 asked Aug 5, 2011 at 13:22 DunhamzzzDunhamzzz 6851 gold badge6 silver badges21 bronze badges 6
  • Maybe you already have the password stored within cookies? – onetrickpony Commented Aug 5, 2011 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 Commented Aug 5, 2011 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 Commented Aug 5, 2011 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 Commented Aug 5, 2011 at 13:59
  • @EAMann, you don't have to add any checks in custom template for this. WP will do this automatically. – Steven Commented Aug 5, 2011 at 15:52
 |  Show 1 more comment

1 Answer 1

Reset to default 2

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.

发布评论

评论列表(0)

  1. 暂无评论