Archived topic
Best way to embed hubspot forms on multiple pages/posts
5 replies · Started by hemant on October 22, 2020
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)?
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.
Without a plugin? Using hooks or other capabilities of the theme/wordpress?
You will need to filter the_content() which as WP core function and requires custom development.
Heres an example of a similar function:
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.
The ad-inserter plugin looks like what I can shoot for. Thank you!
You're welcome