[Resolved] Disclaimer message below Leave a Comment

Home Forums Support [Resolved] Disclaimer message below Leave a Comment

Home Forums Support Disclaimer message below Leave a Comment

Viewing 15 posts - 1 through 15 (of 16 total)
  • Author
    Posts
  • #1020631
    Hilton

    Hi,

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

    “Your email will not be published”

    Thanks

    #1020655
    Leo
    Staff
    Customer Support

    Hi there,

    You can try the below_comments_title hook:
    https://docs.generatepress.com/article/hooks-visual-guide/#single-post
    https://docs.generatepress.com/article/hooks-element-overview/

    Let me know if this helps πŸ™‚

    #1020684
    Hilton

    Hi,

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

    #1020687
    Leo
    Staff
    Customer Support

    Not sure if I understand.

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

    #1020691
    Hilton

    I’ve tried but it didn’t work πŸ™

    #1020694
    Hilton

    It works using before_comments hook, but not using below_comments_title

    #1020696
    Leo
    Staff
    Customer Support

    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?

    #1020699
    Hilton

    I’ve already tried everything πŸ™

    #1020725
    Leo
    Staff
    Customer Support

    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 πŸ™‚

    #1020737
    Hilton

    Hi, didn’t work either https://prnt.sc/pbw501

    #1020738
    Hilton

    ps. I checked “execute PHP”

    #1020741
    Leo
    Staff
    Customer Support

    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 πŸ™‚

    #1020756
    Hilton

    Adding the PHP snippet to functions.php worked for me πŸ™‚

    #1020769
    Leo
    Staff
    Customer Support

    Make sure you are adding it to the child theme’s function.php otherwise it will be erased during updates πŸ™‚

    #1020772
    Hilton

    Yes, sure. Thanks!

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