Site logo

Archived topic

Change comment section to say "comments" instead of "thoughts"

9 replies · Started by Jordan on April 9, 2019

Viewing posts 1–10 of 10

Thanks!

You're welcome

This is a very incomplete answer!

The default seems to be:

1 thought on “Title”
n thoughts on “Title”

Changing the filter to be "What do others say" doesn't account for the case of just one, or more than one, comment, and in any case definitely doesn't answer the original question: how to change the specific word "thought" to the specific word "comment" -- with the plural added as appropriate -- which is what I was also looking for to find this.

(Not to mention, I also tested the linked function, and it did not change the form title in any way....)

Here's what I did that worked: 1) Make sure my child theme has comments.php in it (if not, copy it over from the parent theme). Edit that to change "thought" (in three places) to whatever you wish, such as "comment". Done.

The filter should work :)

But yes child theme method you did works well too.

Thanks for sharing!

A little reverse engineering lead me to a solution that doesn't require copying comments.php:

function al_generate_comment_form_title ($szString)
  {
  $szString = str_replace ('thoughts', 'comments', $szString);
  return $szString;
  }
add_filter( 'generate_comment_form_title', 'al_generate_comment_form_title');

The "trick" is that the filter function is actually passed the title string, which it can then modify and return.

Enjoy,

Leo

Hmmm... who's right? Leo or Leo?

:-D

Haha :)

This archived topic is closed to new replies.