Dear team,
My site is https://1mg.vn/
I am trying to add Infinity Load to Posts. But it is not worked.
Please help me check the below codes that I copied from templates.
Many thanks team
====JS====
<script>
jQuery(window).on( 'load', function(){
var $container = $('.infinity-wrapper');
$container.infiniteScroll({
path: '.load-next-posts',
history: false,
status: '.page-load-status',
});
$container.on( 'load.infiniteScroll', function( event, response, path ) {
var $items = $( response ).find('.infinity-loader');
// append items after images loaded
$items.imagesLoaded( function() {
$container.append( $items );
$container.isotope( 'insert', $items );
setTimeout( function(){
SEMICOLON.initialize.resizeVideos();
SEMICOLON.initialize.lightbox();
SEMICOLON.widget.loadFlexSlider();
}, 1000 );
});
});
});
</script>
====HTML====
<div class="text-center">
<div class="page-load-status hovering-load-status">
<div class="css3-spinner infinite-scroll-request">
<div class="css3-spinner-ball-pulse-sync">
<div></div>
<div></div>
<div></div>
</div>
</div>
<div class="alert alert-warning center infinite-scroll-last mx-auto" style="max-width: 20rem;">End of content</div>
<div class="alert alert-warning center infinite-scroll-error mx-auto" style="max-width: 20rem;">No more pages to load</div>
</div>
</div>
<div class="center d-none">
/template-parts/content-excerpt.php?p=2" class="button button-3d button-dark button-large button-rounded load-next-posts">Load more..
</div><!-- #loader end -->
====Loop====
<?php if ( have_posts() ) : ?>
<?php /* Start the Loop */ ?>
<?php while ( have_posts() ) : the_post(); ?>
<?php get_template_part( 'template-parts/content-excerpt', get_post_format() );?>
<?php endwhile; ?>
<?php else : ?>
<?php get_template_part( 'template-parts/content', 'none' );?>
<?php endif; ?>
