- This topic has 10 replies, 5 voices, and was last updated 3 years, 3 months ago by
Ying.
-
AuthorPosts
-
October 28, 2020 at 3:07 am #1507431
Luis
Hi,
I tried searching for a while and came up empty…
Where it says “Leave a Comment” and the button “Post Comment” for this demo > (https://gpsites.co/read/read-post/)
How do I go about changing this? Is there somewhere simple to edit this or is this with some CSS?
Thank you
October 28, 2020 at 4:40 am #1507554David
StaffCustomer SupportHi there,
this document explains how to change the comment title:
https://docs.generatepress.com/article/generate_leave_comment/
And this filter is used for the Comment Button text:
https://docs.generatepress.com/article/generate_post_comment/
Heres an example of both filters:
add_filter( 'generate_leave_comment', function () { return 'Comment title text'; } ); add_filter( 'generate_post_comment',function () { return 'Post comment button text'; } );October 28, 2020 at 8:51 pm #1508750Luis
Thank you David.
That’s fixed it. 🙂
October 29, 2020 at 2:36 am #1508934David
StaffCustomer SupportGlad to hear that
March 8, 2021 at 10:25 am #1687127Bob
David,
Thank you!
March 8, 2021 at 10:28 am #1687135David
StaffCustomer SupportYou’re welcome
February 26, 2023 at 6:34 pm #2547974lakshman
Could this be implemented on one specific page instead of the whole site?
February 26, 2023 at 6:52 pm #2547990Ying
StaffCustomer SupportHi lakshman,
Yes, you can add conditions to the code, for example, if you want to make changes for the post with id
1add_filter( 'generate_leave_comment', function () { if (is_single('1')) { return 'Comment title text'; } return 'Leave a Comment'; } ); add_filter( 'generate_post_comment',function () { if (is_single('1')) { return 'Post comment button text'; } return 'Post comment'; } );February 26, 2023 at 7:37 pm #2548019lakshman
Hi Ying,
Thank you so much for the prompt response! Above solution worked well for posts but not for pages. Is there anything I need to do to implement it on a specific page only?February 27, 2023 at 12:58 am #2548203lakshman
update: I found a solution! I just asked chatGPT to rewrite for a page and it worked! 😀
// Change comment form title and submit button for specific page with ID 123 add_filter( 'generate_leave_comment', function () { if ( is_page( 123 ) ) { return 'Comment title text'; } return 'Leave a Comment'; } ); add_filter( 'generate_post_comment', function () { if ( is_page( 123 ) ) { return 'Post comment button text'; } return 'Post Comment'; } );Thanks for your help!
February 27, 2023 at 11:01 am #2549038Ying
StaffCustomer SupportI just asked chatGPT to rewrite for a page and it worked!
Haha, that’s a smart move 🙂 Glad to hear that!
-
AuthorPosts
- You must be logged in to reply to this topic.