This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| var that = this; | |
| event.preventDefault(); | |
| var callback = function() { | |
| $(that).parents('#nl_form').submit(); | |
| } | |
| _gaq.push(['_set','hitCallback', callback]); | |
| _gaq.push(['_trackEvent', 'Newsletter Subscription', 'Started', window.location.pathname]); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| scrollTo: function ( y ) { | |
| FB.Canvas.getPageInfo(function(pageInfo){ | |
| $({y: pageInfo.scrollTop}).animate( | |
| {y: y}, | |
| {duration: 500, step: function(offset){ | |
| FB.Canvas.scrollTo(0, offset); | |
| } | |
| }); | |
| }); | |
| }, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| .button | |
| @extend %button-reset | |
| padding: rem(10px) rem(15px) | |
| color: #ffffff | |
| border-radius: 8px | |
| @extend .clickable | |
| &.is-blue | |
| background: linear-gradient(to bottom, $blue 0%, $blue--dark 100%) | |
| &:hover |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| public function write_log ( $log ) { | |
| if ( true === WP_DEBUG ) { | |
| if ( is_array( $log ) || is_object( $log ) ) { | |
| error_log( print_r( $log, true ) ); | |
| } else { | |
| error_log( $log ); | |
| } | |
| } | |
| } |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| jQuery(document).on('click', '.play', function() { | |
| var video = jQuery(this).data('video-name') | |
| dataLayer.push({'video': video, 'event': 'play_video'}); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).on('click', '.my-class', function(event) { | |
| var position = compute_xy_click(event, this); | |
| }); | |
| function compute_xy_click(event, element) { | |
| var position = []; | |
| var gardientPos = $(element).offset(); | |
| var posx = 0; | |
| var posy = 0; | |
| if ( !event ) var event = window.event; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| $(document).on('click', '.widget-promotion a', function(event) { | |
| var title = $(this).text().trim(); | |
| var url = $(this).attr('href'); | |
| dataLayer.push({ | |
| 'event': 'promotion_click', | |
| 'promotion_title': title, | |
| 'eventCallback': function() { window.location = url }, | |
| }); | |
| }); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| <?php | |
| // How to open an XML file and write out it's contents as a CSV! | |
| // Using sample XML file here https://msdn.microsoft.com/en-us/library/ms762271(d=printer,v=vs.85).aspx | |
| $filexml='books.xml'; | |
| if (file_exists($filexml)) { | |
| $xml = simplexml_load_file($filexml); | |
| $f = fopen('books.csv', 'w'); | |
| foreach($xml->book as $book) { | |
| $values = array( | |
| 'author' => $book->author, |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| // Working with dates is annoying. Time is annoying, especially with timezones involved. | |
| // In WP, you have to worry about the timezone set by WordPress AND the timezone set in php.ini. | |
| // A safe bet when working with date logic in WP, is to assume that the timezone set by the WP backend is correct. | |
| // More than likely, an event is local and thus should use WP timezone. | |
| // HOWEVER, when working with php's DateTime class, you need to manually set the timezone or you'll have | |
| // inconsistant dates! Below is a snippet which helps set the timezone, does calculations, and then sets it back. | |
| // Set to WP timezone | |
| $phpTimezone = date_default_timezone_get(); |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| /** | |
| * Grab the upcoming events from the Events Manager plugin. However, we need to make sure only the first | |
| * instance of a recurring event shows up. So, we need to essentially get reccuring/non-recurring events | |
| * and then merge the result set. This is not supported by the plugin currently... | |
| * @return array | |
| */ | |
| function getUpcomingEvents() | |
| { | |
| $upcomingEvents = array(); | |
| $recurring = array(); |