I am trying to: Create archive with AJAX pagination
Link to a page where the issue can be seen: hidden link
I expected to see: Infinite scrolling with all results
Instead, I got: After a user scrolls halfway down the first "page" of results, the next page loads and the first page disappears. If a user continues scrolling, there is no additional issue, but the first page of results is still missing from the list of results. This is happening with all similar AJAX archives on the site.
Hi,
Thank you for contacting us and I'd be happy to assist.
While I can see the issue with the missing first page results on your website's archive, I couldn't reproduce this on my test website. This suggests that something specific to your website is involved.
Looking into your archive page's source code, I noticed that the HTML comment lines which are needed for the infinite scrolling are missing, when the page loads.
Example of normal HTML comments which are wrapped around the infinite scrolling view's page results:
...
<!-- WPV_Infinite_Scroll --><!-- WPV_Infinite_Scroll_Insert -->
...
<!-- WPV_Infinite_Scroll -->
...
Some optimization plugins can strip/remove the HTML comments from the page's mark-up, but if these comments are missing, the AJAX-based infinite scrolling has no way to track where the first page's results end.
I'll recommend testing with all non-Toolset plugins disabled and a default theme like Twenty Twenty-One. If it's fixed, you can start adding the disabled items, one by one, to narrow down to a possible plugin that is removing those HTML comments.
I hope this helps and please let me know if you need any further assistance around this.
regards,
Waqar
Thanks for the info. Cloudflare and our server optimizer were minifying the HTML output, which removed the comments. It is working now.