- This topic has 11 replies, 2 voices, and was last updated 3 years, 4 months ago by David.
June 7, 2018 at 11:21 am #594329Michael
Hi. I use GP Pro + Elementor. I’m trying to show a Mailerlite popup on a clicked event (an html link) on a page. Their instructions say to:
To show a popup when a link on your page is clicked, please insert the following code into the same page where you want the popup to appear.
How can I add the above portion to a page via GP (or Elementor)? There’s also some HTML to add to the link, but I now how to do that part. I’m not a code warrior, so I hope there is a simple way. 🙂
Thanks.GP Premium 1.6.2June 7, 2018 at 11:49 am #594351DavidStaffCustomer Support
Hi Michael, if you are using the GP Default template (Not canvas) then you can add it the GP Hooks > WP_Footer
If you’re using Canvas then you can add it somewhere on the page using Elementor HTML Widget.June 7, 2018 at 12:06 pm #594358Michael
Thanks for your reply. Where do I confirm which one I’m using (default vs. canvas)?June 7, 2018 at 12:12 pm #594361DavidStaffCustomer Support
You would have to had of selected the Canvas template in the post / page editor itself. If your using the GP nav and other theme elements across the site then you are using the Default template.June 7, 2018 at 12:17 pm #594365Michael
Okay, thanks for the info. So if I add the snippet via the GP Hooks, won’t that get loaded on every page of my site and potentially slow it down? If yes, any way to limit it to just a particular page? To implement the Hook, do I just enter the script into the hooks box? Any other steps to activate? Thanks. Sorry these questions are so basic/novice.June 7, 2018 at 1:15 pm #594399DavidStaffCustomer Support
Thats correct, it will load on every page. We can make it conditional to display on certain pages. How many and which pages do you need the script to load?
BTW – edit your first post and remove the script you have added please. And just hit submit when done.June 7, 2018 at 1:18 pm #594401Michael
For now, I just need it on the home page of https://thebookpie.com But eventually (a few months from now) it will need to be on several pages on that site. Thanks again.
~ MichaelJune 7, 2018 at 1:28 pm #594411DavidStaffCustomer Support
OK then i don’t think it will be necessary as the script looks reasonably light but if you want you can wrap the sccipt in this conditional and make sure Execute PHP is checked below the hook:
<?php if ( is_front_page() ) : ?> <script> the script </script> <?php endif; ?>
We can later add more pages to the script by changing it to:
<?php if ( is_front_page() && is_page( [123,456,789]) ) : ?> <script> the script </script> <?php endif; ?>
The numbers in the is_page refer to the separate page ID’s, each one separated by a comma.June 7, 2018 at 7:44 pm #594759Michael
Thanks for the wrapper and tips! I’ll give that a try. I appreciate you also answered what i’ll need to do a few months from now when the site gets built out much more and more pages have the link trigger.
~MichaelJune 8, 2018 at 1:35 am #594914DavidStaffCustomer SupportJune 8, 2018 at 7:22 am #595136Michael
PS: I did the above, and it’s actually not working, it turns out. The Mailerlite people are looking into it right now. I’ll let you know here what’s up — shortly.June 8, 2018 at 7:28 am #595140
- You must be logged in to reply to this topic.