Hi,
I am having the same problem as Runo with this page https://pensamientos.cc/frases/, the first posts are fine but as soon as you infinite scroll loads the 2nd set of posts we lose the sharing icons as Runo described with the twitter share example.
Now following the advice of Micropat, I went ahead and implemented a post-load event as follow but the result still the same:
( function( $ ) {
$( document.body ).on( ‘post-load’, function () {
// New posts have been added to the page.
// A custom “onReady” function for AddToAny
function my_addtoany_onready() {
a2a_config.target = ‘.share-this’;
a2a.init(‘page’);
}
// Setup AddToAny “onReady” callback
var a2a_config = a2a_config || {};
a2a_config.tracking_callback = {ready: my_addtoany_onready};
// Additional a2a_config properties may go here
// Load AddToAny script asynchronously
(function(){
var a = document.createElement(‘script’);
a.type = ‘text/javascript’;
a.async = true;
a.src = ‘//static.addtoany.com/menu/page.js’;
var s = document.getElementsByTagName(‘script’)[0];
s.parentNode.insertBefore(a, s);
})();
});
})( jQuery );
Hopefully you can point me in the right direction.
Thank you.