Copy the LeadForms code
In the quiz editor, open “Publish” → “On website” and expand the “Site code” block. Copy the code, which looks like this:
It is one code for the whole site: it loads all your quizzes and widgets. If it is already on this page, you do not need to paste it again.
<script async src="https://script.leadforms.org/v1.js" data-key="YOUR_KEY"></script>. Your key is already filled in.It is one code for the whole site: it loads all your quizzes and widgets. If it is already on this page, you do not need to paste it again.
Open the post in WordPress
In the WordPress dashboard, go to “Posts” → “All Posts” and open the one where you want the quiz.
Create a new block
In the post editor, click the “+” icon to add a block right where you want the quiz.
Choose the “Custom HTML” block and paste the LeadForms code
In the block list, choose “Custom HTML” and paste the LeadForms code into it. If you don’t see it in the list, use the block search or “Browse all”. Click “Save” (“Update” in older versions of WordPress).
The code has to be on every post or page where the quiz should work.
The code has to be on every post or page where the quiz should work.
Choose how to show the quiz and click “Publish”
Go back to LeadForms, to the “Publish” → “On website” tab. In the “Where the quiz appears” step, choose “Window over the site” or “Side panel”, and in the “How it opens” step choose, for example, “LeadForms button: in the corner or as a banner”, “Auto-open” or “Button on the page”. You can pick several at once.
If you chose “Button on the page”, that is, the LeadForms button inside the post, copy its code, which looks like this:
Click the “Publish” button at the bottom of the tab. Until you do, the changes will not reach your site.
If you chose “Button on the page”, that is, the LeadForms button inside the post, copy its code, which looks like this:
<div data-leadforms-button="ID"></div> (ID is your quiz number).Click the “Publish” button at the bottom of the tab. Until you do, the changes will not reach your site.
Paste the button code and save the post
If you chose “Button on the page”, go back to the post editor and paste
You can skip this step for the LeadForms corner button and for auto-open.
<div data-leadforms-button="ID"></div> where the button should be: into the same “Custom HTML” block right after the LeadForms code, or into a separate “Custom HTML” block. Save the post.You can skip this step for the LeadForms corner button and for auto-open.
Done! The quiz is live
The LeadForms button appears on the page, and clicking it opens the quiz. To check the setup, go to LeadForms, click “Check page” in the “Site code” block and enter the post’s address.
If you prefer your own button
Use this option when the quiz should open from a button that already exists on your page rather than from the LeadForms code.
You still need the LeadForms code: paste it as in steps 1–4 above. You will not need the LeadForms button code in this case.
You still need the LeadForms code: paste it as in steps 1–4 above. You will not need the LeadForms button code in this case.
Get the quiz link from “Your website’s links and buttons”
In LeadForms, on the “Publish” → “On website” tab, in the “How it opens” step, expand “Your website’s links and buttons” and copy the link. These links always work: there is nothing extra to turn on or publish. The quiz will open from any button or link on your site that points to
#leadforms-ID, where ID is your quiz number.
Add the button
Go back to editing the post and insert a button. Give it a label and set its link to
#leadforms-ID, replacing ID with your quiz number.Publish the page
The quiz will open when someone clicks the button.
If the quiz should sit right in the post
You can show the quiz as a block inside the post, with no button and no pop-up. The LeadForms code is needed here too, as in steps 1–4 above.
Choose “Block in the page”
In LeadForms, on the “Publish” → “On website” tab, in the “Where the quiz appears” step, choose “Block in the page” and click “Publish”.
Paste the block code into the post
In the post editor, add a “Custom HTML” block where the quiz should be and paste
<div data-leadforms-block="ID"></div> into it, replacing ID with your quiz number. Save the post.Having trouble with the setup?
If something doesn't work, and we'll sort it out with you.