Skip Navigation

[Resolved] AddToAny not loading on infinite scroll

This thread is resolved. Here is a description of the problem and solution.

Problem: I have the AddToAny plugin active and it should add social sharing buttons to each post in the loop. When I use infinite scrolling, the buttons do not appear for subsequent pages.

Solution: Use the Advanced settings in Pagination to trigger a JavaScript function that triggers the proper jQuery event.

function showSocial(){
 jQuery( 'body' ).trigger( 'post-load' );
}
This support ticket is created 5 years, 5 months ago. There's a good chance that you are reading advice that it now obsolete.

This is the technical support forum for Toolset - a suite of plugins for developing WordPress sites without writing PHP.

Everyone can read this forum, but only Toolset clients can post in it. Toolset support works 6 days per week, 19 hours per day.

Sun Mon Tue Wed Thu Fri Sat
8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 8:00 – 12:00 - -
13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 13:00 – 17:00 - -

Supporter timezone: America/New_York (GMT-04:00)

This topic contains 2 replies, has 2 voices.

Last updated by louE 5 years, 5 months ago.

Assisted by: Christian Cox.

Author
Posts
#1343187

I am trying to:
get the addtoany buttons to appear after load on infinite scroll

Link to a page where the issue can be seen:
hidden link

I expected to see:
After scrolling to bottom of page, and allowing the infinite scroll to load new content, I expected to see the Share: buttons displayed.

From AddToAny support:
"AddToAny supports the standard post-load event.

Ajax and infinite scroll plugins/themes should always fire the post-load event after content insertion, so request standard post-load support from plugin & theme authors as needed."

I have added to the Article Scroll view JS editor : jQuery( 'body' ).trigger( 'post-load' );

#1343237
Screen Shot 2019-09-18 at 2.44.13 PM.png
Screen Shot 2019-09-18 at 2.44.05 PM.png

Hi, you should be able to trigger this event when a new set of results has been loaded. Edit this View and find the Search and Pagination panel. Twirl open the JS editor beneath the panel and add this code:

function showSocial(){
 jQuery( 'body' ).trigger( 'post-load' );
}

Then in the Pagination and Slider Settings 'Advanced Options', you can use showSocial in the Callback JavaScript. I'm attaching some screenshots here. Let me know if you have questions about this.

#1343313

Always a pleasure. My issue is resolved now. Thank you!