Show popup by clicking on a link AT ANY TIME
-
I created five pop-ups. I wish that each popup is shown on the cover page only if it is within a specific time range. So I created a filter in functions.php to do that:
if( ! function_exists('rfa_theme_load_popup') ){ function rfa_theme_load_popup( $is_loadable, $popup_id ) { $popups = array(6003, 6019, 6625, 6024, 6026) ; $stimes = array('08:00', '10:00', '13:00', '16:00', '20:00') ; $dont_load_it = false; foreach( $popups as $key => $popup ) { $dont_load_it = $dont_load_it || (($popup == $popup_id) && ! isCurrentTimeBetween($stimes[$key],$stimes[($key+1)%count($stimes)])); } return $is_loadable && ! $dont_load_it; } add_filter('popmake_popup_is_loadable', 'rfa_theme_load_popup', 100, 2 ); }
However the problem is that I do not know how to distinguish between the automatic display of popup, and when popup is explicitly called through a button. I wish that in the latest case, any popup can be shown at any time. But how?
- The topic ‘Show popup by clicking on a link AT ANY TIME’ is closed to new replies.