Adding popups created in Smartpages to your WordPress site can be done in few simple steps.
With Smartpages dedicated WordPress plugin
If you use one of our plugins (Landing Pages App or Smartpages Landing Pages) and you have your landing page imported thanks to it, you do not have to do anything else – the code enabling the display of the popup will be added automatically in the final stage of creating the popup:
Add a popup to another page powered by WordPress
If you want your popup to be added to your own site (outside Smartpages) powered by WordPress, take the steps indicated below.
- On the final stage of creating the popup in Smartpages, copy the automatically generated HTML code.
- Go to your WordPress dashboard. In the menu on the left, navigate to the Appearance (1) tab and click Theme Editor (2).
- You will see the window with the option to edit the theme in a source code. On the right side, click on Theme Header file (header.php).
- After that, you will see the window with the <!doctype html> code. Paste the code generated in Smartpages to the section, preferably at its end. Remember to do so before the closing tag!
- Click Update File.
IMPORTANT: After pasting the code into the header.php file, it will be installed automatically for the whole page together with all its subpages.
Define where exactly the popup will display
I want my popup to display only on one or chosen subpages
- Copy the code:
In the first function (first line), define on which subpage (or more subpages) the popup should display, e.g., [‘contact’], [‘about_us’], [‘contact’, ‘our_products’].
In the second line, replace our example with the code from the last step of popup publication.
- Paste the whole code at the end of the HTML section in WordPress.
- Click Update File.
I want my popup to display on all of the pages except the selected ones
- Analogously, as shown above, copy the code, this time containing negation (!):
In the first function (first line), define on which subpage (or more subpages) the popup should not display, e.g., [‘contact’], [‘about_us’].
In the second line, replace our example with the code from the last step of popup publication.
- Paste the whole code at the end of the HTML section in WordPress.
- Click Update File.
Choose where to display your popup on the publishing stage
You can choose where to display your popup when you are still on the publishing stage in the Smartpages platform: