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

"There is one thing one has to have: either a soul that is cheerful by nature, or a soul made cheerful by work, love, art, and knowledge."

Friedrich Nietzsche


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