WordPress.org

Support

Support » How-To and Troubleshooting » show % comments for pw-protected post instead of ‘enter your password to view..’

show % comments for pw-protected post instead of ‘enter your password to view..’

  • I’m so close to figuring this out, but I’m just stuck..

    I’m been trying to edit this portion of the comment-template.php

    if ( !empty($post->post_password) ) {
    		if ($_COOKIE['wp-postpass_'. COOKIEHASH] != $post->post_password) {
    			echo(__('Enter your password to view comments'));
    			return;
    		}

    so that the ‘Enter your password to view comments’ part would be changed to the format on public posts, using this code

    <?php comments_popup_link(__('No Comment'), __('1 Comment'), __('% Comments'), 'commentslink', __('Comments are off')); ?>

    It hasn’t worked out for me.

    Don’t know if this matters, but for my pw-protected posts, I have an intro then it is cut off by the <more> asking for a password to see the rest of the post.

    I’d still like to have people who don’t know the password to be able to comment.

    So yes, I’d like to comments in my password protected posts to be made public. Hope I make sense.

    If anyone can help me with this, it’ll be awesome!! Thanks in advanced!

  • The topic ‘show % comments for pw-protected post instead of ‘enter your password to view..’’ is closed to new replies.