Support » Fixing WordPress » Infinite scroll pagination not working for pages outside index.php

  • Im using masonry with infinite scroll to show posts in a loop. It all works great on my index page and search page but when I place the loop on regular page or buddypress profile to show a loop of posts by author then it doesnt scroll past the “post-per-page” set for the loop. It just says no more posts to load. Here’s the loop minus the guts. Any idea why this is happening?

    <div id="boxes">
       if ( have_posts() ) : while ( have_posts() ) : the_post(); ?>
        <?php endwhile; ?>
      <?php endif; ?>
    <div class="infinitescroll">
    <?php next_posts_link( __( 'Load more posts', 'imbalance2' ) ); ?>
    <script type="text/javascript">
     // Infinite Scroll
     var href = 'first';
     $(document).ready(function() {
        navSelector : '.infinitescroll',
        nextSelector : '.infinitescroll a',
        itemSelector : '#boxes .box',
        loadingImg : '<?php echo get_bloginfo('stylesheet_directory') ?>/images/loading.gif',
        loadingText : 'Loading...',
        donetext : 'No more pages to load.',
        debug : false
    }, function(arrayOfNewElems) {
        $('#boxes').masonry('appended', $(arrayOfNewElems));
        if (href != $('.infinitescroll a').attr('href'))
            href = $('.infinitescroll a').attr('href');
  • The topic ‘Infinite scroll pagination not working for pages outside index.php’ is closed to new replies.