Ashley Cameron Design

Ashley Cameron Design

Shop the Creative Design Market

Good evening

Cyber Monday Fancybox Pop up conditional by date and timezone

This post was last updated: Sep 3, 2020
jQueryPHPSnippetsWordPress

About a 1 minute read

"Design is not just what it looks like and feels like. Design is how it works."

Steve Jobs


1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
<?php  //cyber monday
    date_default_timezone_set ( 'America/Chicago' ); //set timezone
    $cybermonday= date( 'm-d-y'); //set cyber monday date

    if ( $cybermonday=='11-30-15' ) { ?>

    <img id="cyber" style="display:none;" src="<?php echo get_stylesheet_directory_uri(); ?>/dir/graphics/cybermonday.jpg"></a>

<!-- Make sure fancybox source files are in theme and enqueued -->
    <script type="text/javascript">
      jQuery(document).ready(function() {
                jQuery("#cyber").fancybox({'padding':0}).trigger('click');
            });
    </script>
<?php } ?>