WordPress.org

Ready to get started?Download WordPress

Forums

Removing any reference to comments on select posts (14 posts)

  1. rsbenedict
    Member
    Posted 10 years ago #

    Hi, Guys!
    I'm still very new to WordPress, but am learning a lot about coding by hand (previously I used dreamweaver and flash). What I would like to be able to do, is to remove any reference to comments on select posts. Basically, when I check the "No Comments" box when writing a post, I don't want any reference to comments underneath that post. I don't want it to say "Comments are currently closed" or make any reference to comments at all. I just want a clean post with the permalink, date, time, and posted by, but no comments.
    Is there a way to do this? Remember, I'm not a programmer (yet!), and I know almost nothing about php.
    Thanks!

  2. Mark (podz)
    Support Maven
    Posted 10 years ago #

    \wp-includes\template-functions-comment.php
    Line 58
    Change the text there ?

  3. resmyrranda
    Member
    Posted 9 years ago #

    I think this is what I'm looking for too but per the previous post, I'm not sure. So...if you remove that line of code, or change the text...change it to what? Then the word "comments" will not even show up in your posts? I ask that because I don't even want it to. hehe. I'll give it a go anyway and hope I don't break sumthin. If I figure its a different way to do this, I'll post here also.

  4. resmyrranda
    Member
    Posted 9 years ago #

    Ah! If you don't even WANT a comments function, go to your index.php template and delete the following:
    <div class="feedback">
    <?php wp_link_pages(); ?>
    <?php comments_popup_link(__('Comments (0)'), __('Comments (1)'), __('Comments (%)')); ?>
    </div>
    That worked beautifully, and when I clicked on each of my categories it didn't show there either, fyi. Coolness.

  5. kannued
    Member
    Posted 7 years ago #

    But deleting this comments function, will delete all comments on ALL posts. What if I only want to remove the comments links on say three posts out of my 200 posts? Is there a way to do this?

    And I'm talking about posts, not pages. It appears that I cannot have custom template posts like custom template pages.

  6. kannued
    Member
    Posted 7 years ago #

    I am using the plugin called "rc-custom-comment-text" to customize the comments such as "No comments". But is there a plugin that will eliminate the comment for certain posts but not all?

  7. Doodlebee
    Member
    Posted 7 years ago #

    ...or, you *could* just uncheck the box next to the post you're writing (underneath "discussions") that says "Allow Comments". That'll close the post to any comments. Then, to remove the "Comments are closed" message, go to your theme editor, and in your templates, look for the message that says "Comments closed for this post" and delete that message. Then *nothing* will appear when comments are closed.

  8. kannued
    Member
    Posted 7 years ago #

    I tried that, but I still get "Comments Off" on the original page.

    http://www.kiplingcitizen.com/index.php?cat=25

    When I click on Comments off, then it goes

    http://www.kiplingcitizen.com/index.php?p=35

    which shows "nothing". But I want nothing on the first link.

  9. Doodlebee
    Member
    Posted 7 years ago #

    Ahh...well, you can do it by hacking a core file...

    open up wp-includes/comment-functions.php in Notepad. Find (witht he "find" function) "Comments Off"...you'll come to a line that says this:

    function comments_popup_link($zero='No Comments', $one='1 Comment', $more='% Comments', $CSSclass='', $none='Comments Off') {

    Remove that "comments off" part, and leave it blank. Save and upload.

  10. kannued
    Member
    Posted 7 years ago #

    This works on this page.

    http://www.kiplingcitizen.com/index.php?p=35#respond

    But on the original page, http://www.kiplingcitizen.com/index.php?cat=25

    I have "Comments (0)" still. Can I eliminate that? I think I would have to add something to the comments.php in the theme directory.

  11. kannued
    Member
    Posted 7 years ago #

    For that matter, can I eliminate the [link] too on both pages?

  12. Doodlebee
    Member
    Posted 7 years ago #

    Actually, it's still there on that first page you listed - it's just not linked (and it's now under your post instead of to the right).

    I don't know - usually I'd just play around until I had it figured out. There *has* to be something somewhere that is calling for it to appear - I just run through files until i find it!

    Sorry I'm not much more of a help!

  13. kannued
    Member
    Posted 7 years ago #

    Doodlebee

    I had re-inserted the "Comments are closed" in my template, what you had asked me previously.

    So on the first page I listed.
    http://www.kiplingcitizen.com/index.php?p=35#respond
    that "Comments are closed" is easy to eliminate, as you stated before. Sorry to change things on you!

    It is on this page
    http://www.kiplingcitizen.com/index.php?cat=25
    where the link for Comments (0) that I would like to eliminate.

    I think I have to put in a conditional "if" clause in the template comment.php that would address the "comments off" in the wp-includes/function-comments.php.

    But I'm not sure how to write that conditional "if" clause, if that is what I need.

  14. kannued
    Member
    Posted 7 years ago #

    Since this is a post where I want to eliminate Comments (0) and not a page, I just have live with the Comments (0). Then I have to ensure that the "No Comment" box is ticked in the writing or editing of the post.

Topic Closed

This topic has been closed to new replies.

About this Topic

Tags

No tags yet.