Archived topic
How to change Leave a comment text?
3 replies · Started by Rishabh on August 17, 2020
This is the page I am referring to: https://www.clichemillennials.com/blog/
I tried putting this code in my functions.php file: https://docs.generatepress.com/article/generate_leave_comment/
But still, it shows "Leave a comment".
In addition to this, I also have this code pasted in my functions.php: https://docs.generatepress.com/article/entry-meta-style/ (Example 1).
Thanks
Hi there,
Try this:
add_filter( 'gettext', function( $text ) {
if ( 'Leave a comment' === $text ) {
return 'Your new text';
}
return $text;
} );
add_filter( 'gettext', function( $text ) {
if ( 'Leave a comment' === $text ) {
return 'Your new text';
}
return $text;
} );
This code is not working for me.
Please help me.
Try this instead:
https://docs.generatepress.com/article/generate_leave_comment/
Adding PHP: https://docs.generatepress.com/article/adding-php/