Site logo

Archived topic

Modify “Leave a Comment” to “Inquiries & Questions” at Post and Page

5 replies · Started by jason on June 29, 2020

Viewing posts 1–6 of 6

I have read "https://docs.generatepress.com/article/generate_post_comment/" but I did not how to do.
Woudl you please tell me how to modify step by step?
Tks a lot

Jason

Tks for kind reply.
Please help again.
1. Where can I find the file "generate_leave_comment" to modify?
2. Can I modify the code at host online? I can download the php file and edit by software "EditPlus 3".
3. I am using the "Marketer" theme now, should I add the code to functions.php file?
add_filter( 'generate_leave_comment','tu_custom_leave_comment' );
function tu_custom_leave_comment() {
return 'Inquiries & Questions';
}

Regards
Jason
Jun.30

You don't need to modify any of the files.

Simple copy this code:

add_filter( 'generate_leave_comment','tu_custom_leave_comment' );
function tu_custom_leave_comment() {
    return 'Inquiries & Questions';
}

And paste it using it one of these methods:
https://docs.generatepress.com/article/adding-php/

The code snippets plugin method is the easiest if you aren't using a child theme already.

I have install the plugin- Code Snippets at web http://www.ztmachines.com.
There are many option at plugin:
Example HTML shortcode
Example CSS snippet
Example JavaScript snippe
Order snippets by name
Order snippets by date

How to add the code?

Tks

Jason

Create a new snippet, copy and paste the code in, then click save and activate.

This archived topic is closed to new replies.