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

织梦调用文章简介[field:description /]如何限制字数

dedecms教程:织梦教程调用文章简介

dedecms教程:织梦教程调用文章简介[field:description /]如何限制字数!在用织梦dedecms系统时,用[field:description /]标签调取文章简介时。

限制字数的方法有下面3种:

第一种方法:(推荐,可加省略号)

[field:description function='cn_substr(Html2text("@me")."...",80)'/] 

调用现成的cn_substr()字符串截取函数来实现,80为限制字节数(一个汉字等于2个字节)

第二种方法:(推荐!)

 使用 [field:infos/] 代替 [field:description/] 在 arclist 标签内设定 infolen='30' 来设定长度;

第三种方法:

织梦默认[field:description/]长度为255个字节,如果想调取更多的字节需要更改以下文件:

dede 文件下的 article_add.php 和 article_edit.php

$description = cn_substrR($description,250);

把250改为你想要的字节 2个字节等于一个中文字符

或者修改数据库表单

dede_archives 里面的 description

把原来的 varchar(255) 改为想要的。

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

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

EcShop通过if判断栏目ID/产品ID的方法

2022-4-29 0:00:00

编程技巧

EcShop商品详情页增加自定义title的方法

2022-5-2 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
----《》
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索