Forums

[resolved] "Comments are closed" in the classic theme (12 posts)

  1. ruix
    Member
    Posted 1 year ago #

    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!!!

  2. dkristine
    Member
    Posted 1 year ago #

    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: http://www.lancelhoff.com/remove-comments-are-closed-text-from-posts/

  3. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    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 (%)')); }?>

  4. ruix
    Member
    Posted 1 year ago #

    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!!!

  5. ruix
    Member
    Posted 1 year ago #

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

    Do you know what's happening?

  6. ruix
    Member
    Posted 1 year ago #

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

  7. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

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

  8. ruix
    Member
    Posted 1 year ago #

    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

  9. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    What's in short-comments.php?

  10. ruix
    Member
    Posted 1 year ago #

    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

  11. esmi
    Theme Diva & Forum Moderator
    Posted 1 year ago #

    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.

  12. ruix
    Member
    Posted 1 year ago #

    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.

    :)

Topic Closed

This topic has been closed to new replies.

About this Topic