Say "Hello!"

  • This field is for validation purposes and should be left unchanged.

Cyber Monday Fancybox Pop up conditional by date and timezone

Web Hosting at Bluehost Affiliate Disclosure

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

Back to Snippets Follow me on GitHub

Ashley Cameron logo
Blog