DedeCMS列表/内容分页页码太多解决方法

路径文件名称: include/arc.archives.class.php

找到代码:for($i=1;$i<=$totalPage;$i++) (注意:共有两处,上面说了,改第二处,大约813行处)。

将以上代码替换为:

            $total_list=10; //只显示10个页码
if($nowPage >= $total_list) {
$i = $nowPage-4; //显示4页
$total_list = $nowPage+4; //显示4页
if($total_list >= $totalPage) $total_list = $totalPage;
}else{
$i=1;
if($total_list >= $totalPage) $total_list = $totalPage;
}
for($i;$i<=$total_list;$i++)

保存arc.archives.class.php文件并上传。登陆dede后台,找到分页比较多的文章,重新生成HTML,再看一下分页的效果。

此条目发表在 技术教程 分类目录。将固定链接加入收藏夹。

发表评论

电子邮件地址不会被公开。 必填项已用 * 标注

*

您可以使用这些 HTML 标签和属性: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>