This repository has been archived on 2023-08-16. You can view files and clone it, but cannot push or open issues or pull requests.
Omphaloskepsis/plugins/jetpack/modules/shortcodes/js/instagram.js
2018-03-21 18:19:20 +00:00

19 lines
567 B
JavaScript

(function( instgrm ) {
var instagramEmbed = function() {
if ( 'undefined' !== typeof instgrm && instgrm.Embeds && instgrm.Embeds.process ) {
instgrm.Embeds.process();
} else {
var s = document.createElement( 'script' );
s.async = true;
s.defer = true;
s.src = '//platform.instagram.com/en_US/embeds.js';
document.getElementsByTagName( 'body' )[0].appendChild( s );
}
};
if ( 'undefined' !== typeof jQuery && 'undefined' !== typeof infiniteScroll ) {
jQuery( document.body ).on( 'post-load', instagramEmbed );
}
instagramEmbed();
})();