WordPress.org

Ready to get started?Download WordPress

Forums

Post Passwords Don't Work... (3 posts)

  1. gahazzah
    Member
    Posted 9 years ago #

    Can somebody explain to me how to get the passworded-posts function to work? It isn't a cookie/cache issue because I've dumped those and the problem still persists.
    I can protect the posts but when I enter the password on the post itself the page refreshed but nothing changes. While I know there are several other threads regarding this issue I have seen no solutions, hence this post.
    Any help would be greatly appreciated.

  2. MattRead
    Member
    Posted 9 years ago #

    gahazzah, is your index.php in a different folder than your WP folder?
    If so you'll need to modify the wp-pass.php file that sets the cookie as follows:
    setcookie('wp-postpass_'.$cookiehash, $_POST['post_password'], time()+60*60*24*30, "/path/");
    notice the extra "/path/". this will be the path to your index.php file. so if your index.php is in your root dir it would be "/". If it was in a dir named blog, it would be "/blog/". and so on...
    Again this is assuming your index.php is in a different directory than your WP folder (wp-pass.php).

  3. gahazzah
    Member
    Posted 9 years ago #

    Thanks for the response MattRead,
    My index.php is in the main wp directory that wp was installed into (/public_html/wp/) and it is being called forward through a php-include so I can wrap it with a header and footer.
    I don't intend to sound stupid but that might be invetibable with the following question...
    would I put the cookie pass as "/wp/"? I tried it and nothing. On the off-chance I also tried it as "/".

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.