[Resolved] Change comment section to say "comments" instead of "thoughts"

Home Forums Support [Resolved] Change comment section to say "comments" instead of "thoughts"

Home Forums Support Change comment section to say "comments" instead of "thoughts"

Viewing 10 posts - 1 through 10 (of 10 total)
  • Author
    Posts
  • #864089
    Jordan

    How can I make the comment section at the bottom say “comments” instead of “thoughts” on this page https://weseekdiscovery.com/best-van-life-essentials/?

    #864155
    David
    Staff
    Customer Support

    Hi there,

    you can use this PHP Filter here:

    https://docs.generatepress.com/article/generate_comment_form_title/

    #864170
    Jordan

    Thanks!

    #864185
    David
    Staff
    Customer Support

    You’re welcome

    #868067
    Randy

    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.

    #868142
    Leo
    Staff
    Customer Support

    The filter should work 🙂

    But yes child theme method you did works well too.

    Thanks for sharing!

    #903720
    Leo

    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

    #903727
    Leo
    Staff
    Customer Support

    SHouldn’t need to copy comments.php when using this filter:
    https://docs.generatepress.com/article/generate_comment_form_title/

    Unless I’m missing something?

    #903923
    Randy

    Hmmm… who’s right? Leo or Leo?

    😀

    #903927
    Leo
    Staff
    Customer Support

    Haha 🙂

Viewing 10 posts - 1 through 10 (of 10 total)
  • You must be logged in to reply to this topic.