Site logo

[Support request] Best way to embed hubspot forms on multiple pages/posts

Home Forums Support [Support request] Best way to embed hubspot forms on multiple pages/posts

Home Forums Support Best way to embed hubspot forms on multiple pages/posts

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

    I’m using a hubspot form to generate leads from the website. What is the best way to make sure that the form is displayed approximately one third of the way down the post/page in between two headings(ie h2 tags)?

    #1499660
    David
    Staff
    Customer Support

    Hi there,

    to do that dynamically the simplest method is to use the Ad Inserter plugin:

    https://wordpress.org/plugins/ad-inserter/

    It allows you to place any shortcode or script function in the post content.

    #1499665
    hemant

    Without a plugin? Using hooks or other capabilities of the theme/wordpress?

    #1499675
    David
    Staff
    Customer Support

    You will need to filter the_content() which as WP core function and requires custom development.
    Heres an example of a similar function:

    https://generatepress.com/forums/topic/insert-html-element-above-first-h2-in-single-posts/#post-873244

    To change which H2 it appears before you need to edit this line:

    $paragraphs[0] = $paragraphs[0].$insertion;

    Change the 0 to 2 in both instances. To place it before the 3rd H2 on the page.

    #1501010
    hemant

    The ad-inserter plugin looks like what I can shoot for. Thank you!

    #1501027
    David
    Staff
    Customer Support

    You’re welcome

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