PHPCMS内容页文章标题添加页码的方法教程

phpcms教程 强烈建议 2024-03-02 10:45 153 0

  如何让PHPCMS的内容页标题显示页码呢?形如:

  引用内容第一页:phpcms教程中心:给PHPCMS内容页添加页码

  第二页:phpcms教程中心:给PHPCMS内容页添加页码 (2)

  第三页:phpcms教程中心:给PHPCMS内容页添加页码 (3)

  第四页:phpcms教程中心:给PHPCMS内容页添加页码 (4)

  ……

  这样不但提高了网页体验率,同时也可以达到SEO优化的效果,让百度、谷歌等多收录一些。下面,就跟随烈火小编一起来看看修改方法吧!

  针对部分,显示完整标题(官方版本是显示截断标题)加第二页页码方法:</p> <p>  你的内容页是否生成静态?否,修改show.php,是修改 include/html.class.php 的 show函数。里面搜索 $head[title] 这个东西。</p> <p>  function show这个函数</p> <p>  里面有</p> <p>  $title = strip_tags($title);</p> <p>  $head['title'] = $title.'_'.$C['catname'].'_'.$PHPCMS['sitename'];</p> <p>  有两处,一个是分页的子标题,一个是没有分页的标题,请注意看</p> <p>  大概是196行左边,里面的判断写的很直接的,应该可以看懂</p> <p>  把这两句改成这个</p> <p>  引用内容</p> <p>  $title = strip_tags($title);</p> <p>  $title = $titleintact ? $titleintact : $title;</p> <p>  $head['title'] = $title.($page>1?'('.$page.')':'').'_'.$C['catname'].'_'.$PHPCMS['sitename'];</p> <p>  另把show.php模板里的标题部分添加:</p> <p>  引用内容</p> <span style='color:#ff0000;padding:10px 0'>本站资源均来自互联网或会员发布,如果不小心侵犯了您的权益请与我们联系。我们将立即删除!谢谢!<span> </div> <div id="related"> <h3>相关文章</h3> <div class="related"> <ul> <li><span>03-02</span><a href="https://teach.xmam.net/post/9688.html" target="_blank" title="mysql更改密码后 配置文件应该改的东西 PHPCMS2008&V9;">mysql更改密码后 配置文件应该改的东西 PHPCMS2008&V9;</a></li> <li><span>03-02</span><a href="https://teach.xmam.net/post/9687.html" target="_blank" title="PHPCMS V9采集地址中有相对路径的问题及解决方法">PHPCMS V9采集地址中有相对路径的问题及解决方法</a></li> <li><span>03-02</span><a href="https://teach.xmam.net/post/9686.html" target="_blank" title="PHPCMS V9不能上传图片的原因">PHPCMS V9不能上传图片的原因</a></li> <li><span>03-02</span><a href="https://teach.xmam.net/post/9685.html" target="_blank" title="phpcms频道模板栏目循环调用优化方法分享">phpcms频道模板栏目循环调用优化方法分享</a></li> <li><span>03-02</span><a href="https://teach.xmam.net/post/9684.html" target="_blank" title="Phpcms V9 调用全站文章排行的解决方法">Phpcms V9 调用全站文章排行的解决方法</a></li> <li><span>03-02</span><a href="https://teach.xmam.net/post/9683.html" target="_blank" title="phpcms 读不到缓存 页面空白的解决方法">phpcms 读不到缓存 页面空白的解决方法</a></li> </ul> </div> </div> </div> </div> <div class="mainr"> <div class="widget widget_previous"> <h4>热门文章</h4> <ul> <li><a href="https://teach.xmam.net/post/1429.html" target="_blank"> <div class="img"><img src="https://teach.xmam.net/zb_users/theme/ydjijian/include/random/4.jpg" alt="DEDE会员注册开启邮箱验证通知正确完整的修改方法"></div><p>DEDE会员注册开启邮箱验证通知正确完整的修改方法</p> </a></li> <li><a href="https://teach.xmam.net/post/17568.html" target="_blank"> <div class="img"><img src="https://teach.xmam.net/zb_users/theme/ydjijian/include/random/10.jpg" alt="DedeCMS让channelartlist支持currentstyle属性"></div><p>DedeCMS让channelartlist支持currentstyle属性</p> </a></li> <li><a href="https://teach.xmam.net/post/1185.html" target="_blank"> <div class="img"><img src="https://teach.xmam.net/zb_users/theme/ydjijian/include/random/2.jpg" alt="织梦删除Power by DedeCms版权链接"></div><p>织梦删除Power by DedeCms版权链接</p> </a></li> <li><a href="https://teach.xmam.net/post/1073.html" target="_blank"> <div class="img"><img src="https://teach.xmam.net/zb_users/theme/ydjijian/include/random/1.jpg" alt="织梦dedecms自定义表单提交成功提示信息和跳转的修改"></div><p>织梦dedecms自定义表单提交成功提示信息和跳转的修改</p> </a></li> <li><a href="https://teach.xmam.net/post/17565.html" target="_blank"> <div class="img"><img src="https://teach.xmam.net/zb_users/theme/ydjijian/include/random/7.jpg" alt="DedeCMS文章列表每5隔行加横线的实现方法"></div><p>DedeCMS文章列表每5隔行加横线的实现方法</p> </a></li> </ul> </div> <div class="widget widget_previous"> <h4>最近发表</h4> <ul> <li><a href="https://teach.xmam.net/post/17568.html" target="_blank"> <div class="img"><img src="https://teach.xmam.net/zb_users/theme/ydjijian/include/random/5.jpg" alt="DedeCMS让channelartlist支持currentstyle属性"></div><p>DedeCMS让channelartlist支持currentstyle属性</p> </a></li> <li><a href="https://teach.xmam.net/post/17567.html" target="_blank"> <div class="img"><img src="https://teach.xmam.net/zb_users/theme/ydjijian/include/random/4.jpg" alt="dedecms站内搜索和tag标签不支持大写字母的解决办法"></div><p>dedecms站内搜索和tag标签不支持大写字母的解决办法</p> </a></li> <li><a href="https://teach.xmam.net/post/17566.html" target="_blank"> <div class="img"><img src="https://teach.xmam.net/zb_users/theme/ydjijian/include/random/9.jpg" alt="DEDE5.7列表页模板中调用TAG标签的方法"></div><p>DEDE5.7列表页模板中调用TAG标签的方法</p> </a></li> <li><a href="https://teach.xmam.net/post/17565.html" target="_blank"> <div class="img"><img src="https://teach.xmam.net/zb_users/theme/ydjijian/include/random/9.jpg" alt="DedeCMS文章列表每5隔行加横线的实现方法"></div><p>DedeCMS文章列表每5隔行加横线的实现方法</p> </a></li> <li><a href="https://teach.xmam.net/post/17564.html" target="_blank"> <div class="img"><img src="https://teach.xmam.net/zb_users/theme/ydjijian/include/random/7.jpg" alt="在个人模板中的调用会员信息的方法"></div><p>在个人模板中的调用会员信息的方法</p> </a></li> </ul> </div> <div class="widget widget_tags"> <h4>标签列表</h4> <ul><li><a target="_blank" href="https://teach.xmam.net/tags-8.html">is</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-28.html">in</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-110.html">go锁屏怎么用</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-149.html">Facebook:实体业务驱动在线服务</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-159.html">新浪2008邮箱正式对外开放注册</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-307.html">SP各地qq群组一览</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-546.html">电脑开机后出现“nobootabledevice”解决办法</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-579.html">陌陌交友暗语有哪些?</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-17.html">方法</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-30.html">修改</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-50.html">id</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-6.html">网站</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-10.html">设置</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-22.html">文件</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-57.html">he</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-29.html">php</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-33.html">代码</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-52.html">me</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-13.html">自定</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-23.html">登录</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-32.html">数据</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-40.html">信息</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-41.html">生成</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-54.html">for</a></li><li><a target="_blank" href="https://teach.xmam.net/tags-59.html">用户</a></li></ul> </div> </div> </div> </div> <div id="footer"><div class="footer container"><p>Copyright 风格酷教程网 Teach.Xmam.Net.Some Rights Reserved. <a href="https://beian.miit.gov.cn/" target="_blank">陕ICP备19008415号</a> 技术支持: <a href="http://www.xmam.net/" target="_blank" title="风格酷模板网">网站模板</a></p><p style='display:none'>Powered By <a href="https://www.zblogcn.com/" title="Z-BlogPHP 1.7.3 Build 173290" target="_blank" rel="noopener norefferrer">Z-BlogPHP</a> Theme By <!--不可删--><a href="https://zidian.openjq.com/" target="_blank">open前端</a></p></div></div> <div class="bottom_tools"> <a id="scrollUp" href="javascript:;" title="返回顶部"><i class="fa fa-angle-up"></i></a> </div> <script src="https://teach.xmam.net/zb_users/theme/ydjijian/script/common.js?v=1.7.3" type="text/javascript"></script> <script src="https://teach.xmam.net/zb_users/theme/ydjijian/script/custom.js?v=1.7.3" type="text/javascript"></script> <script src="https://teach.xmam.net/zb_users/theme/ydjijian/script/swiper.jq.min.js?v=1.7.3" type="text/javascript"></script> <script> var swiper = new Swiper( '.swiper-container', { loop: 'true', pagination: '.swiper-pagination', nextButton: '.swiper-button-next', prevButton: '.swiper-button-prev', paginationClickable: true, spaceBetween: 30, centeredSlides: true, autoplay: 5500, autoplayDisableOnInteraction: false } ); </script> </body> </html><!--240.18 ms , 9 queries , 3031kb memory , 0 error-->