This file contains 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
<!-- Place this tag just before your close body tag and NOT in your <head> --> | |
<script> | |
(function(d, t) { | |
var g = d.createElement(t), | |
s = d.getElementsByTagName(t)[0]; | |
g.async = true; | |
g.src = 'https://apis.google.com/js/plusone.js'; | |
s.parentNode.insertBefore(g, s); | |
})(document, 'script'); | |
</script> |
This file contains 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 | |
class My_Plugin_Options { | |
var $options; | |
var $option_name; | |
var $is_site_option; // Are we using Multisite and saving to global options? | |
function My_Plugin_Options($option_name, $is_site_options = false){ | |
$this->option_name = $option_name; | |
$this->is_site_option = $is_site_options; | |
if($this->is_site_option){ |
This file contains 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
// Get all of the images that are marked up to lazy load | |
const images = document.querySelectorAll('.js-lazy-image'); | |
const config = { | |
// If the image gets within 50px in the Y axis, start the download. | |
rootMargin: '50px 0px', | |
threshold: 0.01 | |
}; | |
// The observer for the images on the page | |
let observer = new IntersectionObserver(onIntersection, config); |