Open ghost opened 7 years ago
My guess that maybe the trigger (nextSelector) is outside of the contentSelector.
The next link should be inside the posts container, like this:
<div class="posts-container">
<div class="post">Post here...</div>
<div class="post">Post here...</div>
<div class="post">Post here...</div>
<a href="/page2/">Next page</a>
</div>
The following code works for me:
$('.site-main').jscroll({
contentSelector: '.post-listing',
nextSelector: '.posts-navigation a:first'
});
<main id="main" class="site-main">
<?php
if ( have_posts() ) : ?>
<div class="post-listing">
<?php
while ( have_posts() ) : the_post(); ?>
<?php
get_template_part( 'template-parts/post/content', 'entry' ); ?>
<?php
endwhile; ?>
<nav class="posts-navigation" role="navigation">
<?php next_posts_link('Next Entries','') ?>
</nav>
</div>
<?php
else :
get_template_part( 'template-parts/content', 'none' );
endif; ?>
</main>
Implementing on Wordpress. Works for page 1 and 2, but doesn't go farther. Scroll down to bottom, I should see a footer and pagination. I only see the footer. There are no plugins active on my site. Has anyone run into this?