Found This: tyty stack, Social Icons not working with Infinite Scrolling on Wordpress
I'm doing the same thing they are, only with two more buttons, StumbleUpon and Pinterest
i'm looking for the script function calls for the Pinterest 'Pin It' Button and the StumbleUpon Badge / Widget
i found something for StumbleUpon, but it's not ideal,
no clue on Pinterest, still looking, wrote them a cheery letter.
here's the code i'm pasting into the Infinite Scroll Settings "Javascript to be called after the next posts are fetched" TextArea,
// jQuery Masonry,
var newElems = jQuery( newElements ).css({ opacity: 0 });
newElems.imagesLoaded(function(){
newElems.animate({ opacity: 1 });
jQuery('#content').masonry( 'appended', newElems, true );
});
// ReCall Scripts for Social Sharing Buttons
var el = document.body;
//Google Plus
if (typeof gapi !== "undefined") { gapi.plusone.go(el); }
//Facebook
if (typeof FB !== "undefined") { FB.XFBML.parse(el); }
//Twitter
if (typeof twttr !== "undefined") { twttr.widgets.load(); }
//Pinterest
//StumbleUpon
(function() {
var li = document.createElement('script'); li.type = 'text/javascript'; li.async = true;
li.src = 'https://platform.stumbleupon.com/1/widgets.js';
var s = document.getElementsByTagName('script')[0]; s.parentNode.insertBefore(li, s);
})();
stay classy, stack.
I've built an HTML5-valid Pinterest button alterantive and posted it on GitHub. It provides a PinterestPlus.pinit()
method that works just like gapi.plusone.go()
, etc.
I hope it can help in your projects!