Warning: Undefined array key "night" in /www/wwwroot/dhaomu.com/wp-content/themes/b2/header.php on line 18

织梦调用上一篇下一篇以及样式修改

dedecms教程:织梦教程调用上一篇下一篇以及样式修改!不管是仿模板还是设计模板,内容页中肯定需要用到"上一篇,"下一篇"标签调用。

dedecms教程:织梦教程调用上一篇下一篇以及样式修改!不管是仿模板还是设计模板,内容页中肯定需要用到"上一篇,"下一篇"标签调用。

第一种、直接调用"上一篇,"下一篇"

上一篇是{dede:prenext get='pre'/}
下一篇是{dede:prenext get='next'/}

第二种、去除上一篇和下一篇的文字,只显示标题。

修改include/arc.archives.class.php 文件,查找"上一篇"关键词,将上一篇去除及可,或者大家也可以改成其它需要的文字

第三种、限制上一篇和下一篇的标题长度

同样是在include/arc.archives.class.php文件里面,加入如下红色代码,设置默认24个字符,中文也就是12个文字。

//获取上一篇,下一篇链接
function GetPreNext($gtype='',$titlelen=28)

再往下找,插入红色部分!即是用截取后的长度赋予$preRow['title2'],那么原始没截取的就是$preRow['title']

$preRow['namerule'],$preRow['typedir'],$preRow['money'],$preRow['filename'],$preRow['moresite'],
$preRow['siteurl'],$preRow['sitepath']);
  $preRow['title2']=cn_substr($preRow['title'],$titlelen);
  $this->PreNext['pre'] = "上一篇:<a href='$mlink'

然后在前台模板就可以这样调用了。

<li style="float:left;" title="上一篇">{dede:prenext get='pre' titlelen = '18′/}</li>
  <li style="float:right;" title="下一篇">{dede:prenext get='next' titlelen = '18′/}</li>
温馨提示:
1.本站大部分内容均收集于网络!若内容若侵犯到您的权益,请发送邮件至:duhaomu@163.com,我们将第一时间处理!
2.资源所需价格并非资源售卖价格,是收集、整理、编辑详情以及本站运营的适当补贴,并且本站不提供任何免费技术支持。
3.所有资源仅限于参考和学习,版权归原作者所有,更多请阅读网站声明

给TA赞赏
共{{data.count}}人
人已赞赏
编程技巧

DiscuzPING快速实现百度秒收录

2020-11-3 0:00:00

编程技巧

Discuz的QQ登陆提示connect_error_code_20003错误代码:2000

2020-11-5 0:00:00

0 条回复 A文章作者 M管理员

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914

Warning: Trying to access array offset on value of type null in /www/wwwroot/dhaomu.com/wp-content/themes/b2/functions.php on line 3914
----《》
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索