在Ecshop文章列表页显示内容摘要
- 2019年11月28日
- beetheme.cn
- 已收录
- 35
(window.slotbydup = window.slotbydup || []).push({
id: "u6201117",
container: "_loc2j2sosji",
async: true
});
本教程中讲到的“内容摘要”指的是文章内容的前 60个字符(当然也可以是前40个,前50个等等)
下面以 2.7.2版 + 官方默认模板 为例进行讲解:
1)、修改 includes/lib_article.php 文件
搜索
$sql = 'SELECT article_id, title, author, add_time, file_url, open_type' .
一共能搜到两处,每一处都改为
$sql = 'SELECT article_id, title,content, author, add_time, file_url, open_type' .
继续找到
$arr[$article_id]['title'] = $row['title'];
在它下面增加一行代码
$arr[$article_id]['content'] = strip_tags($row['content']);
2)、打开 模板文件 /themes/default/article_cat.dwt
搜索找到
{$article.short_title}</a>
在它后边增加代码
<br>{$article.content|truncate:60}
精彩推荐
也想出现在这里?联系我们吧
本站承接 WordPress / DedeCMS / ThinkPHP 等
系统建站、仿站、开发、定制等业务!
1. 本站所有资源来源于用户上传和网络,仅作为演示数据,如有侵权请邮件联系站长!
2. 本站承接各类网站建设,仿站,多平台小程序搭建制作!
3. 本站联系QQ:897918909
beetheme资源网 » 在Ecshop文章列表页显示内容摘要
2. 本站承接各类网站建设,仿站,多平台小程序搭建制作!
3. 本站联系QQ:897918909
beetheme资源网 » 在Ecshop文章列表页显示内容摘要