WordPress.org

Ready to get started?Download WordPress

Forums

[resolved] Comments not showing up on password protected posts. :( (5 posts)

  1. cupkate
    Member
    Posted 2 years ago #

    Hello everyone!

    I have a wee problem. :(

    For some reason, my comments and comment form show up fine on a regular public post, however when I make the post password-protected, the comments or comments form do not show up at all, even when the password is entered.

    I don't know how to fix it, I've got a little headache now after spending so long trying different methods, yet nothing has worked. :( I spent the last hour trailing google and trying different things, so I figured I'd post here and hopefully someone may kindly help me out or know what I have to add/remove!

    Thanks for your time!

  2. cupkate
    Member
    Posted 2 years ago #

    And wouldn't you know, I just fixed it! XD Very sorry, please ignore this post. *happy bunny* :)

  3. dhin
    Member
    Posted 2 years ago #

    Do you know how? Because Comments not showing up on my site and also my old comments are gone

  4. cupkate
    Member
    Posted 2 years ago #

    I had to replace the top piece of my comments.php file:

    <?php // Do not delete these lines
    if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    die ('Please do not load this page directly. Thanks!');
    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?>
    <?php
    return;
    }
    }
    ?>

    with

    <?php // Do not delete these lines
    if ('comments.php' == basename($_SERVER['SCRIPT_FILENAME']))
    die ('Please do not load this page directly. Thanks!');
    if ( post_password_required() ) { ?>
    		<p class="nocomments">Please enter password to view comments</p>
    	<?php
    		return;
    	}
    ?>

    This is what worked for me, anyway! :)

  5. hlgbccheer
    Member
    Posted 1 year ago #

    Darn, this solution did not work for me! Digging around the Forums, I see that others are having this problem and it seems to be theme specific. When I revert back to the WordPress default theme, the comment box reappears and the problem is gone. I'm using the Fadonet Alien theme. I took a break from blogging for a year and a half, and the problem seems to have only happened since then because I've never had this problem before. My old comments are still visible, it's just that no one can make comments now using this theme. Anyone?

Topic Closed

This topic has been closed to new replies.

About this Topic