我已按照自定义主题的 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()
?>
我应该使用功能删除它以使无限滚动工作吗?