Skip to content

Instantly share code, notes, and snippets.

@timersys
Last active December 13, 2019 14:56
Show Gist options
  • Star 2 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save timersys/d68690a85aed14a02318 to your computer and use it in GitHub Desktop.
Save timersys/d68690a85aed14a02318 to your computer and use it in GitHub Desktop.
Wordpress popups - Open popup with link
// To open popup with ID 3 on same page (preferred)
<a href="" class="spu-open-3" title="Click here">Click here</a>
// Another way
<a href="#spu-3" title="Click here">Click here</a>
// To go to a new page and open a popup there
<a href="http://mydomain.com/new-page/#spu-3" title="Click here">Click here</a>
@capariciof
Copy link

Hello, you know how I can make the popup open automatically using a command in php or html?

I have a condition function (if... else) in php and I require the popup to open in some condition.
Thank you

@collinvb
Copy link

Hi Timersys, could I add the popup to a premium theme's button element, so that a user clicks a button for the form to popup?

Here I'm using the theme 'Massive Dynamic' and would like the popup to work by adding a link to the "Link URL" area shown in this Microsoft OneDrive image: https://1drv.ms/u/s!AkAY-dRACUrgkqdqeE-SOwC1u-9Sew

@gonzalesc
Copy link

@collinvb yes. You just have to follow the steps established above.

@tomvesa
Copy link

tomvesa commented Feb 22, 2019

Hi,
is it possible to add a URL Query when opening a Gravity form in a pop up using a link as a trigger?
When I use your method above the form is empty without a prepopulated fields. Prepopulation works when not using a form in a popup.

Link looks like this:
<a href="my.site/page-name?country=australia" class="spu-open-18" title="Click here">Click here</a>

This way it does not work.

@gonzalesc
Copy link

Hi. Do you still with this problem?

@ellkam
Copy link

ellkam commented Dec 12, 2019

Hello,
I'm afraid it only works partially. In the German version the popup works, in the English version translated with WPML it doesn't work.
The link looks the same as the German one, but with /?lang=en at the end.

<a href="https://www.mypage.de/layout---------/-------/?lang=en" class="spu-open-4358" title="Click here">Click here</a>

@timersys
Copy link
Author

Hi @ellkam, you should use trigger class instead of urls.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment