• Resolved ruix

    (@ruix)


    I’ve been customizing the classic theme. I unchecked the comments checkbox for every post but I’m still seeing an annoying message: “Comments are closed”. I went to the file comments.php and found this:

    <?php else : // Comments are closed ?>
    <p><?php _e(‘Sorry, the comment form is closed at this time.’); ?></p>
    <?php endif; ?>

    I thought this was the code I had to change. But it has nothing to do with “Comments are Closed”.

    Does anybody know where this message is coming from?

    Thx in advance!!!

Viewing 11 replies - 1 through 11 (of 11 total)
  • If you have disabled comments on all posts, open single.php and remove
    <?php comments_template(); ?> from the template file.

    There is a great tut here: https://www.lancelhoff.com/remove-comments-are-closed-text-from-posts/

    Try editing the theme’s index.php file and changing:

    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>

    to:

    <?php if('open' == $post->comment_status) { comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); }?>

    Thread Starter ruix

    (@ruix)

    OMG….ESMI YOU DID IT!!!!!!!!!!!!!

    THANK YOU VERY MUCH!!!!

    I’ve been trying for days and could not get a solution.

    I was using <?php comments_template( ‘/short-comments.php’ ); ?> to get the post content. I just replace that line with the one you gave me and finally it works perfectly.

    Thx again!!!

    Thread Starter ruix

    (@ruix)

    oh…there’s another problem. Now, The comments that should appear inside every post are not visualized :S

    Do you know what’s happening?

    Thread Starter ruix

    (@ruix)

    @dkristine I am using the classic theme, and it does not have that file you mentioned (single.php) :S:S

    Ensure that index.php contains <?php comments_template(); ?>

    Thread Starter ruix

    (@ruix)

    The annoying message is still there.

    The code:

    <?php the_content(); ?>
    <?php comments_template( '/short-comments.php' ); ?>
    <?php if('open' == $post->comment_status) { comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); }?>

    :S

    What’s in short-comments.php?

    Thread Starter ruix

    (@ruix)

    I got this line of code from wordpress codex…I looked for it and couldn’t find where that file is :S

    I deleted the reference to that file, and it shows up an error :S

    Try just using <?php comments_template();?> for now. If you read the relevant Codex page fully, you’ll see that in order to change the default comments display, you’ll need to create your own comments template file called (for example) short-comments.php. That’s when you’d use <?php comments_template( '/short-comments.php' ); ?> to call your customised comment display.

    Thread Starter ruix

    (@ruix)

    Thank you again.

    I did this: <?php comments_template( 'comments.php' ); ?>

    and changed the messages that appeared inside that comments.php, such as No comments, and 0 comments, and the posts were not affected.

    ??

Viewing 11 replies - 1 through 11 (of 11 total)
  • The topic ‘“Comments are closed” in the classic theme’ is closed to new replies.