WordPress.org

Ready to get started?Download WordPress

Forums

Removing custom pagination and using jetpack infinite scroll (1 post)

  1. Evolutionsic
    Member
    Posted 1 year ago #

    I'm having a couple problems, I've followed the Jetpack Infinite scroll instructions for custom themes and still it doesn't work!

    I've found a pagination.php in theme/framework/functions/pagination.php and i don't know if this is taking over or making it not work can someone please pretty please?

    This is the pagination code

    <?php
    //custom pagination function
    function pagination($pages = '', $range = 4) {
         $showitems = ($range * 2)+1;
         global $paged;
         if(empty($paged)) $paged = 1;
    
         if($pages == '') {
             global $wp_query;
             $pages = $wp_query->max_num_pages;
             if(!$pages) {
                 $pages = 1;
             }
         }  
    
         if(1 != $pages) {
             echo "<div class=\"page-pagination\"><div class=\"page-pagination-inner clearfix\">";
    		 echo "<div class=\"page-of-page\"><span class=\"inner\">".$paged." of ".$pages."</span></div>";
             for ($i=1; $i <= $pages; $i++) {
                 if (1 != $pages &&( !($i >= $paged+$range+1 || $i <= $paged-$range-1) || $pages <= $showitems ))
                 {
                     echo ($paged == $i)? "<span class=\"current outer\"><span class=\"inner\">".$i."</span></span>":"<a href='".get_pagenum_link($i)."' class=\"inactive\"><span class=\"inner\">".$i."</span></a>";
                 }
             }
              echo "</div></div>\n";
         }
    } // end pagination()
    ?>

    should i delete it with the function to get infinite scroll working?

Topic Closed

This topic has been closed to new replies.

About this Topic