I have infinite scroll enabled on a query loop. It works fine on desktop, but no extra posts appear after the initial 12 on mobile.
Is there something I need to do to make it work on mobile?
I have infinite scroll enabled on a query loop. It works fine on desktop, but no extra posts appear after the initial 12 on mobile.
Is there something I need to do to make it work on mobile?
Hi Simon,
Thanks so much for your report!
I see the following error in the console:
{
"code": "rest_api_authentication_required",
"message": "The REST API has been restricted to authenticated users.",
"data": {
"status": 401
}
}
Are you using a performance or security plugin that blocks access to the REST API?
In Perfmatters, for example, there is a setting called “disabling REST Api for non Admin”.
Best regards,
timmse
Hello Sly, did you solve this issue? As I’m having the same issue right now and the solution from Timmse is not the issue in my case.
Hi, I’m sorry, I should have replied to my own post. Yes, I had the Rest API disabled and that affected loading on mobile only.
Thanks for the update. Indeed, it affects only mobile.
Hi all,
Is there any way we can get this to work while still disabling the rest api for security?
Edit:
I was able to create a utility plugin that disables all but the necessary API routes for non-logged-in users. This does allow the infinite scroll and load more to function, while securing your API details. You can also change the API url from /wp-json to something else for more obfuscation