Archived topic
Infinite scroll with Ajax Load More
7 replies · Started by Almog on July 25, 2022
Hi,
I use the Ajax Load More plugin to add infinite scroll to my website. the problem is that the plugin loads also the current post.
I have asked the plugin author how to fix that, and he said:
"You’ll have to pass the post ID to the post__not_in shortcode parameter."
any idea how can I do that in generatepress?
Hi Almog,
I’m not familiar with Ajax Load more, but are you using a shortcode to query posts through that plugin? Or, are you using a different plugin to query posts?
Kindly let us know.
I am using a shortcode to query posts through that plugin
I see. I’m not sure about their syntax. It would be best to reach out to them as well regarding this. I found this article which may help though: https://connekthq.com/plugins/ajax-load-more/docs/parameters/
Ok, thanks
Another issue I have with the infinite scroll is that the featured image of the posts that it loads are smaller than they should be.
This depends only on the featured image, the rest of the images inside the content of the posts that are loaded from the plugin are fine. here is an example: https://midnightpets.com/are-ferrets-smarter-than-cats/ (just scroll to the bottom and it will load the next post)
any suggestion on how to fix that?
In Appearance > Customize > Layout > Blog > Featured Images > Posts, check if your media attachment size is set to full.
If it is already, may you ask the support of the plugin as well regarding this issue?
So I have checked with the plugin author, and for the problem that the plugin loads also the current post, he explained that it is theme related, and showed me what to do: https://wordpress.org/support/topic/one-post-loads-to-soon/#post-15861594 so can you please explain to me how do I implement that on my site?
He’s not saying it’s theme related. He means that you need to alter whichever theme you’re using, specifically, the files for their plugin to work.
Are you trying to implement this in the archive?
This is the archive template file: https://github.com/tomusborne/generatepress/blob/master/archive.php
You’ll need to use a Child theme, create a new archive.php file and modify it to the specifications of the plugin.
Hope this clarifies!