- This topic has 3 replies, 2 voices, and was last updated 3 years, 4 months ago by
David.
-
AuthorPosts
-
December 23, 2022 at 5:27 am #2471468
Frank89233@gmail.com
Hi,
I’d like to add a text just below the comment box stating that privacy rules apply and a link to my data protection page.
I’ve tried several things but couldn’t get it to work.I have created a child theme already and tried to adapt the comments.php… Maybe with GP this is not the right way to go?
Could you please give me some advice, how I could easily implement this?
Thanks
FrankDecember 23, 2022 at 9:16 am #2471769David
StaffCustomer SupportHi there,
GP uses the core
comment_form()function and it has a few Hooks you can use – see here:https://wpengineer.com/2205/comment-form-hooks-visualized/
you can use them with a GP Hook Element:
https://docs.generatepress.com/article/hooks-element-overview/
1. In Appearance > Elements -> Add New Hook.
2. Add the HTML you want to display.
3. Set the Hook to Custom and add your comment form hook name egcomment form after fields
4. Set the Display Rules to Posts > All Posts.Note if you want you can use the Block Element instead if you want use blocks for your content.
The same applies as the above.December 23, 2022 at 2:35 pm #2471939Frank89233@gmail.com
Thanks a lot for the quick response.
Documentation looks good, but seems to be outdated. Could that be the case?I have enabled Elements as described here: https://docs.generatepress.com/article/hooks-element-overview/
But I don’t have all the options shown here: https://wpengineer.com/2205/comment-form-hooks-visualized/
I’d like to use the comment_form_after hook, but the only hooks the selection list provides to me with regard to comments are:
– generate_before_comments_container
– generate_before_comments
– generate_inside_comments
– generate_below_comments_titleThat’s it…
Anything wrong with my installation ?December 24, 2022 at 5:04 am #2472240David
StaffCustomer SupportWe don’t list the core hooks aside from those that are in the GeneratePress templates (
wp_head,wp_body_open,wp_footer). As the list would be huge and we wouldn’t know if those hooks were present in a particular page.In these cases:
1. Set the Hook to:
Custom Hook
2. In theCustom Hook Namefield it provides, paste in your hook ie.comment_form_after -
AuthorPosts
- You must be logged in to reply to this topic.