Comment policy before comment area

Posted in: Newspaper
Post count: 85

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?

Post count: 35449

Hi BruceInLouisville,

Please provide some more details about this code, where it need to be set, a link from where you got it, in this way I will be able to inspect it and provide an answer.
Also are you use a pro demo? what post style are you using?

Thank you!

Post count: 85

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.

Post count: 35449

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!

Post count: 85

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.

Post count: 35449

Hi,

If you are not using a cloud template for posts and is a standard one, then yes, it will be use the files from tagDiv standard pack.

Thank you!

Viewing 6 posts - 1 through 6 (of 6 total)
You must be logged in to reply to this topic.