[Support request] Add Newsletter form after content in single.php

Home Forums Support [Support request] Add Newsletter form after content in single.php

Home Forums Support Add Newsletter form after content in single.php

Viewing 2 posts - 1 through 2 (of 2 total)
  • Author
    Posts
  • #1604572
    Kristoffer

    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.

    #1604593
    Elvin
    Staff
    Customer Support

    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/

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