Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Wordpress page password protection is not working. Page still visible

First time trying to use the password protected visibility option on a Wordpress page, and it seems to do nothing. After adding a password, if I view the page it never asks for a password. Different browsers, clearing out all temporary files, logging out of wordpress admin, nothing makes a difference. Even logged into a remote computer that had never been to the site or admin and opened the page without any prompt for a password. Has anyone else ran into this issue? My Google skills are failing me.

like image 770
joren Avatar asked May 19 '10 15:05

joren


2 Answers

Ended up discovering that the template needed the content() function in it for the password prompt to appear. For those that are in my situation and need to password protect content or PHP scripts in a whole template, this works http://wordpress.org/support/topic/346373

like image 161
joren Avatar answered Nov 20 '22 07:11

joren


Seems like the theme has to support this functionality. I found out that you have to use something like this to make it work

<?php 
    if (post_password_required()) { 
        echo get_the_password_form();
    } else {
        echo "<p>Protected content</p>";
    }
?>
like image 27
Mladen Janjetovic Avatar answered Nov 20 '22 08:11

Mladen Janjetovic