WordPress.org

Ready to get started?Download WordPress

Forums

How to remove Comments off section (16 posts)

  1. myers1984
    Member
    Posted 6 years ago #

    Hello.
    I have turned comments off but get the message "Comments off" on all my pages.
    I am wondering how do you remove it so it doesnt have it there at all.

    Website:
    http://www.metalobsession.net
    Thanks.

  2. whooami
    Member
    Posted 6 years ago #

    Please acquaint yourself with using the search function of the forum.

    http://wordpress.org/support/topic/157844?replies=12

  3. intricateartist
    Member
    Posted 6 years ago #

    That doesn't explain how to remove the text "comments off" without removing the entire line of code. Where can the text be altered?

  4. intricateartist
    Member
    Posted 6 years ago #

    ahh. got it in the template tags section:

    <?php comments_popup_link('0 comments', '1 comment',
    '% comments', 'comments-link', 'Comments off'); ?>
  5. envt
    Member
    Posted 6 years ago #

    A bit more detail follows on how I got "Comments Off" to not appear.

    The code noted above that has to be changed (or removed) is this:

    <?php comments_popup_link('0 comments', '1 comment',
    '% comments', 'comments-link', 'Comments off'); ?>

    This code is in a file called "comment-template.php" and that file resides in the wp-includes folder. It took me a long time to find that file. All I did was remove the words "Comments off" from between the single quotes. Thus the html code that is generated and sent to a browser will just write nothing, eliminating "Comments Off".

    I agree with others who say that it would be good to have a switch for removing all commenting components of WordPress for those who do not wish to have commenting become part of their blog. That goes for other interactions such as trackbacks, which, even if eliminated as an option, appears to still be an avenue for spam.

  6. envt
    Member
    Posted 6 years ago #

    One other tip. Searching php files using the Windows search utility does not work...that's why I had trouble finding the comment-template.php file...I searched for the term "Comments Off" but as php files were not searched, it did not come up. Here's a decent explanation of how to get the Windows search utility to find key words within php files: http://cow.neondragon.net/index.php/72-Searching-Php-Files-With-Windows-Search. It took a bit of doing, but it worked!

  7. moshu
    Member
    Posted 6 years ago #

    This code is in a file called "comment-template.php" and that file resides in the wp-includes folder.

    Very bad advice!
    Core files should NOT be edited ever.
    Just remove the line from the theme's template files. Done.

  8. puckrat
    Member
    Posted 6 years ago #

    @myers1984 ... I think maybe I understand what you're asking for ==> you'd like for the comments references (i.e. comments off) to not show when a given post is not set to have comments. I found a method that works for me, with the theme I'm using. Perhaps it will work for others as well. My particular theme was showing the comment input box even when comments were off *and* I wanted to get rid of that oh so annoying "comments off" message. So ...

    With my theme it meant editing three theme files:

    • archive.php
    • comments.php
    • index.php
    • In each case, where I didn't want the comment info to show if comments were off I placed the comment line display in an if statement:

      <?php if ('open' == $post-> comment_status) : ?> ... <?php endif; ?>

      i.e.

      | <?php comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?>

      becomes

      <?php if ('open' == $post-> comment_status) : ?> | <?php comments_popup_link('Leave a Comment', '1 Comment', '% Comments'); ?><?php endif; ?>

      Note: This has some additional work needed, as the comments info will not show at all if comments are off. Meaning if you had comments on, received comments, and then turned comments off ... nothing of those previously received comments will be seen. I imagine something to do with

      <?php if ($comments) : ?><?php endif; ?>

      might be helpful in evaluating, and some sort of tiered if/then/else statement with the comments and comment_status variables. But that's as far as I got this morning. :p

  9. ThinkBachs
    Member
    Posted 5 years ago #

    Please acquaint yourself with using the search function of the forum.

    http://wordpress.org/support/topic/157844?replies=12

    People that write crap responses like this shouldn't be posting. I can't tell you how many times I've started looking for an answer using Google and found a post like this where some self-righteous moron "blesses" us with his magnanimous gesture of "good will and supreme intelligence."

    This is probably the same guy who goes to an auto repair shop to have his oil changed, spark plugs installed, and to have someone tell him where his circuit breakers are... Just because you know something, doesn't mean you know everything.

  10. mishko
    Member
    Posted 5 years ago #

    Everybody who's looking to turn off the Comments Off text that shows when your comments are off and find that:

    http://wordpress.org/support/topic/157844?replies=12
    OR
    editing the comments_popup_link('No Comments »', '1 Comment »', '% Comments »')

    Don't Work ...

    then follow Puckrat's advice and put an If statement in your template(s) file.

    Thanks to all from 365Halloween.com

  11. thisisedie
    Member
    Posted 5 years ago #

    People that write crap responses like this shouldn't be posting.

    People that can't look for and find the answers to simple questions that have already been answered a thousand times shouldn't be using WordPress.

  12. Anna Johansson
    Member
    Posted 5 years ago #

    Detecting some hostility, anyone?

    *giggle*

    Let's all be friends now.

  13. Justin Tadlock
    Member
    Posted 5 years ago #

    <?php comments_popup_link('0 comments', '1 comment','% comments', 'comments-link', false); ?>

    Using false removes the "Comments Off" message.

  14. itsnotlevel
    Member
    Posted 5 years ago #

    thanks for the detailed posts.....really helped!!! a lot of people dont even let people know they fixed their problem....what good does that do any of us, right......thanks again!!!

    Paul

  15. boorg
    Member
    Posted 5 years ago #

    I did it so...:
    in my template folder ...wp-content/themes/K2
    edit CSS file...
    where there was something about comments, feeds, rss, and rest of stuff I wanted to hide... I simply add:
    display:none;
    eg.: .comments {
    text-align: left;
    margin: 30px 0 0;
    position: relative;
    display:none;

    }

  16. donbukriv
    Member
    Posted 5 years ago #

    Hey Boorg,

    Your solution worked perfectly.

    Thanks man!

Topic Closed

This topic has been closed to new replies.

About this Topic