最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

pagination - Blog Posts - Scroll to view more

programmeradmin4浏览0评论

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
Add a comment  | 

1 Answer 1

Reset to default 0

Load 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();
    }
});
发布评论

评论列表(0)

  1. 暂无评论