Archived topic
Add Newsletter form after content in single.php
1 reply · Started by Kristoffer on January 4, 2021
Hi.
I would like to have a newsletter form after the content on single posts.
If I generate some code from Klaviyo or MailChimp, where should I put it?
Thanks.
Hi,
You don't necessarily have to edit the single.php to place your form after single posts contents.
You can use Hook Element to hook your code in for this.
https://docs.generatepress.com/article/hooks-element-overview/
Using Hook Element, You can place your generated code on its code text area. You then hook it on generate_after_content and set the display rule location to "posts - all posts" so it only appears on single post pages.
More info: You can use our Hook visual guide to know which hook to use:
https://docs.generatepress.com/article/hooks-visual-guide/