Change site style→

style-1 style-2
  1. nazenani
  2. >
  3. >
  4. >
  5. >
  6. Protected pages do not accept you?

Protected pages do not accept you?

When we use different site urls between WordPress url and site url, protected pages may not be opened.
This problem can be solved by the script below.

Important part is ★.
Originally, “site_url()” was “home_url()”. I rewrote “home_url()” to “site_url()“.

“site_url()” gets site url as you set in WordPress. “home_url()” gets home url of your WordPress site.
When inputting password and trying to open protected page, WordPress return us followiong url “http://***.**/wp-login.php?action=postpass””. The part “http://***.**” is equivalent to the path to WordPress directory.

So now your question will be solved. Where is your WordPress directory? If the path to WordPress directory accord site url, you should code “site_url()” at that. If the path accord home url, you should write code home url.

WordPress codex


Fields with * is required.

go to related tags archive?