[Resolved] How to rename Leave a comment to Add a comment on Archives?

Home Forums Support [Resolved] How to rename Leave a comment to Add a comment on Archives?

Home Forums Support How to rename Leave a comment to Add a comment on Archives?

Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #637508
    Jericho

    Hi GP Team,

    I enabled/checked the Display comment count under Layout -> Blog -> Archives.

    How can I rename the Leave a comment to Add a comment in Archives? In the single post, I already changed it since I am using the Jetpack Comments and they have an option to change it on Jetpack Settings.

    Thanks!

    #637942
    Leo
    Staff
    Customer Support

    Hi there,

    Try this:
    https://docs.generatepress.com/article/generate_leave_comment/

    Let me know πŸ™‚

    #638008
    Jericho

    Hi Leo,

    It does work on a single post but not on Front Page, Archive Pages, and Search Results. as I mentioned, I can easily change the Leave a comment on a single post via the settings on Jetpack Comments. What I want to change is the one on Front Page, Archive Pages and Search Results since I made it visible via the option on Layout -> Blog -> Archives -> Display comment count.

    Screenshot: http://prntscr.com/kdgls6

    Thanks!

    #638203
    Tom
    Lead Developer
    Lead Developer

    Hi there,

    Give this a shot:

    add_filter( 'gettext', 'tu_change_leave_a_comment_text', 20, 3 );
    function tu_change_leave_a_comment_text( $translated_text ) {
        if ( 'Leave a comment' === $translated_text ) {
            $translated_text = 'Your text here';
        }
    
        return $translated_text;
    }

    Let me know πŸ™‚

    #638292
    Jericho

    Hi Tom,

    It worked!

    Thanks!

    #638307
    Tom
    Lead Developer
    Lead Developer

    You’re welcome πŸ™‚

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