本教程中講到的“內容摘要”指的是文章內容的前 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}
新聞熱點
疑難解答