I have a page with all my blog posts in it and I have it set to show all my posts on one page. (See screenshot) Now am I looking for away to only show 10 posts at a time and on scroll show more. I see there are plugins like this / but this needs a pagination, I do not want a pagination because of SEO reasons. (new SEO errors come up when a new page for the pagination comes up)
Is there away to this with jquery or javascript?
I have a page with all my blog posts in it and I have it set to show all my posts on one page. (See screenshot) Now am I looking for away to only show 10 posts at a time and on scroll show more. I see there are plugins like this https://en-ca.wordpress.org/plugins/ajax-load-more/ but this needs a pagination, I do not want a pagination because of SEO reasons. (new SEO errors come up when a new page for the pagination comes up)
Is there away to this with jquery or javascript?
Share Improve this question asked Feb 24, 2022 at 21:12 user979331user979331 131 gold badge2 silver badges8 bronze badges 2- You want to load all the posts at one time? The loading will slow. – amiad Commented Feb 24, 2022 at 21:44
- I am okay with that – user979331 Commented Feb 24, 2022 at 22:28
1 Answer
Reset to default 0Load all the posts and hide them exclude 10. If the user scroll to page bottom show more 10.
$('article').each((i, el) => {
if (i > 9){
$(el).hide();
}
});
$(window).scroll(() => {
if ((window.innerHeight + window.scrollY) >= document.body.offsetHeight) {
$('article:hidden').first().show();
}
});