-
AuthorPosts
-
June 30, 2018 at 7:44 am #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
FlorianJuly 2, 2018 at 9:11 am #980012Hey 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,
IsmaelJuly 2, 2018 at 12:15 pm #980058Hi 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
FlorianJuly 3, 2018 at 5:01 am #980382Hi,
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,
IsmaelJuly 3, 2018 at 7:32 am #980424Thank you very much, exactly what I needed :-)
July 4, 2018 at 12:41 am #980829Hi,
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 -
AuthorPosts
- The topic ‘Add text below comment form’ is closed to new replies.
