删除自定义分页并使用jetpack无限滚动

时间:2013-01-03 12:30:57

标签: wordpress pagination infinite-scroll

我已经按照Jetpack Infinite滚动说明进行了自定义主题,但仍然不起作用!

我在theme / framework / functions / pagination.php中找到了一个pagination.php,我不知道这是否正在接管或使其失效。

这是分页代码

<?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()
?>

我应该用函数删除它以获得无限滚动工作吗?

0 个答案:

没有答案