Skip Navigation

[Resolved] Infinite scroll not working correctly

This support ticket is created 5 years, 10 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 12 replies, has 3 voices.

Last updated by Christian Cox 5 years, 10 months ago.

Assisted by: Christian Cox.

Author
Posts
#1194744

Hi

For some reason when I enable infinite scroll when you get down to the bottom it swaps out the content that's already on the screen with the next content, after its done this and you scroll down further it then starts to add to the list.

Any ideas what might be causing this?

Thanks.

#1195119

Hi, can you try these troubleshooting steps first?
- Temporarily deactivate all plugins except Types and Views, then activate a default theme like Twenty Nineteen
- Test again. If the problem is resolved, reactivate your theme and other plugins one by one until the problem returns.
- If the problem was not resolved, open the browser console and check for any errors when the results are updated.

Let me know the results and we can go from there.

#1196426

Hi Christian

So I disabled every single plugin but Types and Views, even Toolset Forms, then installed Twenty Nineteen - however I still had the exact same issue, the content doesn't appear below when scrolling but instead just changes the first offers in view and then starts to expand the list.

I tested this out on beta.wowfreebies.com

I can give you a login if you like to test it if you like?

Cheers.

#1196674

I have the same problem, I do this, and finally the errors in console are:
"A bad HTTP response code (404) was received when fetching the script."
"Failed to load resource: net::ERR_INVALID_RESPONSE"

New threads created by Christian Cox and linked to this one are listed below:

https://toolset.com/forums/topic/infinite-scroll-not-working-correctly-error-404-in-console/

#1196722

Okay thanks comercial2 I have split your issue into a separate ticket so we can investigate in more detail. It may or may not be identical to this issue. Matt, yes please provide login credentials here so I can take a closer look.

I remember seeing an issue where Cloudflare HTML minification was used on the server environment, and it broke Infinite Scrolling: https://toolset.com/forums/topic/infinite-scroll-replaces-first-10-posts-but-thereafter-works-properly/
Matt, are you on Cloudflare?

#1199188

Hi Christian,

It looks like fully disabling Cloudflare (and all caching, minifying plugins) solved the issue, I guess I can try to work out now which Cloudflare/plugin feature is the cause. Is there a specific script that infinite scroll uses that I could exclude from my caching plugin?

Also although it does work there isn't any graphic to show more content is loading? I see options for "Spinners" graphics but these don't appear when I get near the bottom of the page? Would be good to show something so that the user knows more content is loading.

Thanks.

#1199262

Also although it does work there isn't any graphic to show more content is loading?
In your Advanced Settings for this View, what do you have set for caching and preloading? You shouldn't expect to see the spinner in some cases where if caching and pre-loading are on.

Is there a specific script that infinite scroll uses that I could exclude from my caching plugin?
In the other ticket, the problem was related to cached AJAX payload from admin-ajax.php.

#1200135

Hey Christian,

Hmm both caching and preloading are on (Preloading 2 pages) but there is quite a delay before the content loads when a user scrolls, I would expect the spinner to still appear if there is a delay between the content loading so the user knows what’s going on?

See the screenshot below so you can see the settings I have in place for the page. Maybe I’m doing something wrong?

hidden link

In terms of script I was more thinking the JavaScript file the page uses to make infinite scroll work, what is this? I could then ensure this isn’t minified or cached. Admin-Ajax.php I don’t think is anyway. I imagine Toolset inserts some JavaScript to make this work, does it not?

Thanks for your help, I think I am fairly close now to this being resolved. 😀

#1200199

Well you shouldn't minify ANY of Toolset's static files, as a general rule. There's nothing wrong with caching them in the browser or on the server - they're static until another version of the plugin is released. When that happens, the system automatically appends the correct plugin version number as a URL parameter, which should force a reload.

Where can I see the infinite scroll on the site? I'd like to check and see how it's working in the browser.

#1200428

Right ok, what files does Toolset load on the front end then that we should exclude from our plugin minifying / combining?

You can see the infinite scroll on this page - hidden link

Cheers!

#1200644

Right ok, what files does Toolset load on the front end then that we should exclude from our plugin minifying / combining?
You should exclude every JavaScript file in the plugin directory (and its subdirectories) for each Toolset plugin. If the system offers wildcards, you could filter something like:
wp-content/plugins/types/**/*.js
wp-content/plugins/wp-views/**/*.js
... and so on for each Toolset plugin in use.

#1204073

OK no problem thanks, just trying to figure out now why the spinner graphic is not loading/show when its loading more content on the page?

Thanks.

#1205682

You must insert the spinner shortcode in your View's Search and Pagination editor panel. It will look something like this:

[wpv-filter-spinner spinner="<em><u>hidden link</u></em>"][/wpv-filter-spinner]

I can't tell from the front-end if this has been added or not. With preloading turned on, you may not see a spinner. With preloading turned off, you should see a spinner appear after a brief delay when you reach the bottom of the list of results.