Replies: 0
Conditionally opening Popup Maker popup
I am trying to conditionally load a popup in WordPress. The popup is configured in the plugin Popup Maker and has a CSS class of “popmake-2503”.
I’ve created a function in my theme’s functions.php which loads a script conditionally:`
FUNCTION.PHP
/*POPUP MAKER PLUGIN*/
// open popup
function open_popup() {
if( is_user_logged_in() && is_page('checkout') )
{
wp_enqueue_script(
'open-popup',
get_stylesheet_directory_uri() . '/open-popup.js',
array( 'jquery' )
);
}
}
add_action( 'wp_footer', 'open_popup' );
JS:
jQuery(document).ready(function($) {
setTimeout(function() {
// alert ('runningssssssssssssss');
$('.popmake-22784').popmake('open');
}, 2000);
});
How can display this popup in this page
this is screen shots to understand
https://ibb.co/KjKJ5X3
https://ibb.co/h26RST8
thank you