Change "Comments Are Closed" text

  • bjthornton

    #2083

    Hi. When comments are disabled, I would like to change the “Comments are closed” text to read something different. Can someone tell me where in the .php files I can find that response, so I can alter the text? Thanks. I’ve looked through comment.php and function.php to no avail.

    Anonymous

    #18535

    Hi bjthornton,

    The file is actually a core wordpress file rather than a theme file.

    You will need FTP to access this file. It is located in your main WordPress install directory, and its called wp-comments-post.php.

    Mod

    Kenneth John Odle

    #18536

    You can easily do this in a child theme by using the filter in the functions.php file:

    function comment_reform ($arg) {
    $arg['title_reply'] = __('My God, it's full of stars!');
    return $arg;
    }
    add_filter('comment_form_defaults','comment_reform');

    +5 charisma if you recognize the quote.

    Ken

    Anonymous

    #18537

    Are you kidding!! 2001: A Space Odyssey! One of my favorites.

    Mod

    Kenneth John Odle

    #18538

    Indeed. +5 charisma to you, Josh.

    The only problem with this approach is that it changes the title for all comments, so it only works if all of your comments are disabled. (and thus, -5 intelligence to me).

    But I’m working on it.

    Anonymous

    #18539

    These <>, not these []… have you been programming today??

    Mod

    Kenneth John Odle

    #18540

    Fixed it. Wow, can’t believe I did that. My mind is going, Dave. I can feel it….

    Anonymous

    #18541

    Haha… Too funny!!

    bjthornton

    #18542

    Hey, guys, thanks for your help. However, I’m still having the same problem.

    In the wp-comments=post.php, I found this:

    if ( !comments_open($comment_post_ID) ) {

    do_action(‘comment_closed’, $comment_post_ID);

    wp_die( __(‘Sorry, comments are closed for this item.’) );

    But even when I changed the text, my page still says simply “Comments are closed”, as you can see on this page of my blog: http://bjthornton.com/huth

    I’m using Disqus and blog-in-blog, in case that has anything to do with it.

    Kenneth, thanks but I don’t know what “using the filter” means? But I won’t have all of the comments disabled all of the time, only on occasion.

    Thanks again.

    Anonymous

    #18543

    Well, it might be in one of those files. I don’t use either plugin, so I’m unfamiliar with the file structure of each. I would search each of the files for the string “Comments are closed”.

Viewing 10 posts - 1 through 10 (of 11 total)

You must be logged in to reply to this topic.

Do NOT follow this link or you will be banned from the site!