Archived topic
Editing WordPress template files
10 replies · Started by Janine on October 12, 2018
Hi.
Would what template I would have to open to edit the text in the image? This text appears below the comment box and above the Post Comment button. Thank you!
Here's the link: https://drive.google.com/open?id=1b_2ssaY6igauy1LXWlPbtBvnw6dBjlHq
Hi there,
Which one are you wanting to edit? Both?
Hi, Tom.
I would like to be able to edit both? Thank you!
For the "save my name" text, you could try this:
add_filter( 'comment_form_default_fields', function( $field ) {
$commenter = wp_get_current_commenter();
$consent = empty( $commenter['comment_author_email'] ) ? '' : ' checked="checked"';
$fields['cookies'] = '<p class="comment-form-cookies-consent"><input id="wp-comment-cookies-consent" name="wp-comment-cookies-consent" type="checkbox" value="yes"' . $consent . ' />' . '<label for="wp-comment-cookies-consent">TEXT FOR CHECKBOX HERE</label></p>';
return $fields;
}, 20 );
I'm not sure about the subscribe text, unfortunately. Is that being added by a plugin?
No, it isn't plug-in. I use the native WordPress commenting system.
How would I use the code above? When I add it to Additional CSS in the Customizer, it has errors. Or, is it a function?
Thanks, Tom.
Strange, that checkbox shouldn't be there by default. Do you have Jetpack installed?
That code can be added using one of these methods: https://docs.generatepress.com/article/adding-php/
Hi, Tom.
No, JetPack installed. I do have Akismet installed. Thank you.
No other plugins?
That text needs to be coming from a plugin as far as I know:
https://wordpress.org/plugins/subscribe-to-comments-reloaded/
https://wordpress.org/plugins/comment-notifier-no-spammers/
https://wordpress.org/plugins/subscribe-to-comments/
Thanks, Tom.
No problem. Let me know if you figure out where the checkbox is coming from and I might be able to help change the text :)
Hi, Tom. I will.