Site logo

Archived topic

Disclaimer message below Leave a Comment

15 replies · Started by Hilton on September 27, 2019

Viewing posts 1–15 of 16

Hi,

I'd like to know how can I add a message just below comments title.

"Your email will not be published"

Thanks

Hi,

Yes, it helped. But how can I add a single line paragraph?

Not sure if I understand.

What if you just add this as the hook content?
<p>Your email will not be published</p>

I've tried but it didn't work :(

It works using before_comments hook, but not using below_comments_title

So nothing shows at all?

Did you set the display rules to all posts for the element?

Can you try clearing and disabling your caching plugin first?

I've already tried everything :(

Can you try this PHP snippet instead?

add_action( 'comment_form_top', 'tu_comments_notify_message' );
function tu_comments_notify_message() {
	echo '<p>Your email address will not be published. Required fields are marked with *.</p>';
}

Adding PHP: https://docs.generatepress.com/article/adding-php/

I'll look into why the hook doesn't work.

Let me know :)

ps. I checked "execute PHP"

Try using one of the methods in the Adding PHP link I provided above.

Code Snippets is the easiest if you aren't using a child theme.

Let me know :)

Adding the PHP snippet to functions.php worked for me :)

Make sure you are adding it to the child theme's function.php otherwise it will be erased during updates :)

Yes, sure. Thanks!

This archived topic is closed to new replies.