is anybody here using Elementor? How do you trigger the Popup via code? For example.
function popup_call(){
...
if(....){
//trigger the popup here...
}
}
is anybody here using Elementor? How do you trigger the Popup via code? For example.
function popup_call(){
...
if(....){
//trigger the popup here...
}
}
5
Answers
Elementor's Popup needs to be register and trigger. This topic might help you.
Use the wp_footer hook to register your popup.
Read the comments for more clarification.
This question has already been answered:
https://github.com/elementor/elementor/issues/7077#issuecomment-595570337
or try to bind your popup to a button, hide the button with css
and use click with js (jquery)
If the second method helps you, do not forget to hide the button from screen readers
aria-hidden="true" and tabindex="-1"
I don’t know why you need code, if you need to open a pop up on click and without showing the url at the buttom of browser (works like an a tag), give "Custom Classes" a try.
for me, it worked like this with WordPress 5.7.2 and elementor pro 3.2.1
Just set the ID
https://github.com/sukiwp/popup-trigger-url-for-elementor-pro
You are required to set the Display Conditions settings of your popup to pages where you want the popup to show. Otherwise, your popup won’t show up.