Ashley Cameron Design

Ashley Cameron Design

Shop the Creative Design Market

Good morning

Cyber Monday Fancybox Pop up conditional by date and timezone

This post was last updated: Sep 3, 2020
jQueryPHPSnippetsWordPress

About a 1 minute read

"This is the real secret of life — to be completely engaged with what you are doing in the here and now. And instead of calling it work, realize it is play."

Alan Watts


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 } ?>