<?php
/YuanZiFan Add Code 加总页数
$TheURLforthisPage=$_SERVER['REQUEST_URI'];
$arrayForPageNum=explode('/', $TheURLforthisPage);
$CurrentPageNum=end($arrayForPageNum);
$CurrentPageNum=$arrayForPageNum[3];
$RedirectURL="/".$arrayForPageNum[1]."/".$arrayForPageNum[2]."/";//除了页面以外的地址
if ($CurrentPageNum=='') {$CurrentPageNum=1;}
$allcontentthispage=$post->post_content;
$pagenavCode = 'nextpage';
$total_Page_nums=substr_count($allcontentthispage,$pagenavCode);
$total_Page_nums=$total_Page_nums+1;
//YuanZiFan Add Code 加总页数
?>
主要是同构‘NextPage’来拆分页面。判断多少个nextPage,页码数就是多少。
通过URL中的地址段,获取URL中的页面信息,得知当前是第多少页。文章源自原紫番博客-https://www.yuanzifan.com/54463.html
文章源自原紫番博客-https://www.yuanzifan.com/54463.html
站长微信
扫码添加(注明来意)
Yuanzifan99
原梓番博客公众号
博客内容精选
原梓番博客












评论