本教程中讲到的“内容摘要”指的是文章内容的前 60个字符(固然也能够是前40个,前50个等等)
下面以 2.7.2版 + 官方默认模板 为例进行讲解:
1)、修改 includes/lib_article.php 文件
搜索php
$sql = 'SELECT article_id, title, author, add_time, file_url, open_type' . |
一共能搜到两处,每一处都改成sql
$sql = 'SELECT article_id, title,content, author, add_time, file_url, open_type' . |
继续找到url
$arr[$article_id]['title'] = $row['title']; |
在它下面增长一行代码spa
$arr[$article_id]['content'] = strip_tags($row['content']); |
2)、打开 模板文件 /themes/default/article_cat.dwt
搜索找到教程
{$article.short_title}</a> |
在它后边增长代码ip
<br>{$article.content|truncate:60} |