Archived topic
How to add your email address will not be published
9 replies · Started by CRISTO on May 6, 2018
This question was asked a couple years ago, and Tom gave this suggestion. But when I use the simple php plugin to add it to my site it does not seem to work. Am I missing something?
add_action( 'generate_below_comments_title','generate_comments_email_message' );
function generate_comments_email_message()
{
?>
<p class="comments-email-message">Your email address will not be published. Required fields are marked with *.</p>
<?php
}
That should work. How are you adding the PHP?
Using Code snippets plugin. Always worked OK so far (a few neg reviews, but that always happens)....perhaps if there is some css I could use instead? I use your simple css plugin....works great of course.
Hmm, that should work. You're sure the snippet is activated?
Good question, but yes, it's activated to " run snippet everywhere"
I use it for a couple other things, search box and mobile header, and it works fine.
Maybe some setting I have wrong somewhere else? Or perhaps I copied the snippet wrong?
Again, this is my snippet:
add_action( ‘generate_below_comments_title’,’generate_comments_email_message’ );
function generate_comments_email_message()
{
?>
<p class=”comments-email-message”>Your email address will not be published. Required fields are marked with *.</p>
<?php
}
Let's try this 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>';
}
Tom, Tom, Tom.....you deserve a raise. Worked perfectly. Thanks so much. Sorry about the raise, though, things are a little tight right now.
Glad I could help! :)
Your service in phenomenal.....great help to a novice like me.
Thank you! That's great to hear :)