Hello! I want to add some text before the comment area to point users to our comment policy. I got the following code from WPBeginner, but it is not working. (It is in a custom functions add-in for our site.)
===================================================
function forwardky_comment_text_before($arg) {
$arg[‘comment_notes_before’] = “<p>We are glad you have chosen to leave a comment. Please keep in mind that comments are moderated according to our comment policy.</p>”;
return $arg;
}
add_filter(‘comment_form_defaults’, ‘forwardky_comment_text_before’);
===================================================
I suspect it may be because Newspaper doesn’t use ‘comment_form_defaults’ for the comments section. I know I can do this with a plugin, but I’d rather avoid that if possible.
Thoughts?
I’m using Newspaper 10, and the standard post styles that were there in Newspaper 9. Not using a cloud template for posts.
The code came from WP Beginner: https://www.wpbeginner.com/wp-themes/how-to-style-wordpress-comment-form/
I added it to our custom functions plugin, but it doesn’t seem to work. As I said, I suspect it is because Newspaper uses another term for the comments area, but I’m not sure.
Hi BruceInLouisville,
This code will be apply on standard post style, it will not apply on single post template, maybe only if you implement it in the single post template code -> wp-content/plugins/td-cloud-library/shortcodes/single/tdb_single_comments.php
Thank you for your understanding!
I did some more digging, and realized there is a comments.php in the Standard Pack (which I am using). I tried editing that, and got close. Trying to track the build of the comments form through multiple PHP files is tiresome, though.
It appears that the code I showed you is ignored by the Standard Pack comments.php. I’ll keep working on it.