Viewing 6 posts - 1 through 6 (of 6 total)
  • Author
    Posts
  • #979567

    Hi,
    what’s the easiest way to add own text below the comment form? I want to add:

    Hinweise zur Verarbeitung Deiner Angaben und Widerspruchsrechte: Datenschutzerklärung.

    Using the new privacy policy link is no option for me since I don’t want a check box which is mandatory to be checked before being able to comment. I only want to display this information.
    I am using a child theme already.
    Best regards
    Florian

    #980012

    Hey gooflo,

    Thank you for using Enfold.

    You can use the “comment_form_default_fields’ to add more fields to the comment form. Default fields are author, email, url and cookies.

    // https://developer.wordpress.org/reference/hooks/comment_form_default_fields/

    Best regards,
    Ismael

    #980058

    Hi Ismael,
    thanks for your answer, but does it also allow simple text without any input field? Because that’s what I’d like to do.
    If yes, how would I add the text “hello world” below the standard comment fields?
    Best regards
    Florian

    #980382

    Hi,

    Yes, it’s possible. Use this filter in the functions.php file.

    add_filter( 'comment_form_fields', 'avf_privacy_comment_text', 10, 1);
    function avf_privacy_comment_text($fields)
    {	
    	$output = '<p class="comment-form-avf-privatepolicy">Hinweise zur Verarbeitung Deiner Angaben und Widerspruchsrechte: <a target="_blank" href="#">Datenschutzerklärung</a>.</p>';
    	$fields['comment-form-avf-privatepolicy'] = $output;
    	return $fields;
    }

    Adjust the href attribute of the link tag.

    Best regards,
    Ismael

    #980424

    Thank you very much, exactly what I needed :-)

    #980829

    Hi,

    Awesome! Glad we could help!

    Please take a moment to review our theme and show your support https://themeforest.net/downloads
    Don’t forget to bookmark Enfold Documentation for future reference.

    Thank you for using Enfold :)

    Best regards,
    Ismael

Viewing 6 posts - 1 through 6 (of 6 total)
  • The topic ‘Add text below comment form’ is closed to new replies.