十一
11

在WordPress系统中,默认的首页和目录页、搜索页使用的是全文输出,这对于文章内容较长的博客来说很不方面,下面我介绍一个方法,可以简单的实现在WordPress首页和目录页显示摘要而非全文。

1、首先到这里下载插件。解压后上传到wp-content/plugins/

wp-CJK-excerpt 1.3 下载地址

在后台“插件”管理激活

2、 修改模板(index.php,archive.php,search.php

首先找到wp-content/themes下你使用的模板目录,查找目录中的文件,修改index.php(或home.php)、archive.php、search.php,找到<?php the_content(); ?>这一行,将其修改为以下代码:

把 the_content() 替换为 the_excerpt()

这样你的首页、存档页、搜索页都可以以摘要的形式显示,就和我的博客阿杜在线一样了。

相关日志



Tags: , ,

View:607 views

No Responses

Leave a Response

XHTML: You can use these tags: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>