WordPress.org

Ready to get started?Download WordPress

Forums

Suggestion: Turn off comments completely (4 posts)

  1. tagesk
    Member
    Posted 7 years ago #

    When I want my site to be free of comments, completely, nada, I need to edit the theme. "Comments are closed" is not at all what I want - I don't want comments AT ALL and no declaration that there are no comments. I suggest to add a variable that authors fo themes can test (and users set) such as no-comments-on-any-post, say, so they can remove the call to comments_popup_link() in that case.

  2. Kafkaesqui

    Posted 7 years ago #

    You can do this in your template:

    <?php if( comments_open() ) comments_popup_link(); ?>

    Better than a variable. Note this should also work:

    <?php if( 'open' == $post->comment_status ) comments_popup_link(); ?>

  3. q4sales
    Member
    Posted 7 years ago #

    I've tried this PHP code and it doesn't turn off the comment mark in the blog. Still shows "No Comments" which is what i was trying to shut off as well. Is the code to be somewhere very specific in the PHP script?
    TJ

  4. DeanK
    Member
    Posted 7 years ago #

    To do this, I do what you do tagesk -- just edit the theme and remove the comments code.

    However, with one site, I think it's time for comments to re-appear, so if you do it this way, I'd suggest making sure you keep a copy of the original code on hand.

    I don't like to just comment out code (no pun intended!) as it still runs through and processes, and just doesn't get displayed.

Topic Closed

This topic has been closed to new replies.

About this Topic