Hello, I’m using wordpress to make a site and I have a problem. I password protected the page, but when the page is password protected the comments won’t show up. I think it is to do with the following code snipet:
[php]if (!empty($post->post_password)) { // if there’s a password
if ($_COOKIE['wp-postpass_' . COOKIEHASH] != '$post->post_password') { // and it doesn't match the cookie
?>
<p class="nocomments">This post is password protected. Enter the password to view comments.</p>
<?php
return;
}
}
[/php]
For some reason when the person logs in to the page, it triggers the “this post is protected enter the password to view comments” the page is viewable but the message at the bottom prints where the comment section should be. There is no spot to enter a password so a user could see the comments, but I think it should automatically show the comments. The code above obviously checks if the password is correct, but does anyone see anything wrong with how it is set up? If I comment this loop out comments are present at all times, which I don’t want I want the user to log in to see the page and comments.
I have a lot of experience with ansi C and C++, a small amount of HTML but absolutely nothing with php. Please Help!!
thanks in advance!