首先,复制一份目录中page.php文件,重命名为archives,当然这个可以根据自己的喜好随便起名。

其次,按照下面的替换其中的代码,从而可以让主题识别这个归档独立页面:

<?php $this->need('header.php'); ?>

把上面这行替换为如下:

<?php

/**  
  • archives

  • @package custom
    */

$this->need('header.php'); ?>

接着,按照以下代码进行替换,其替换的代码为归档的核心代码:

<?php $this->content(); ?>

找到上面这行代码,替换为如下:

<?php $this->widget('Widget_Contents_Post_Recent', 'pageSize=10000')->parse('<li>{year}-{month}-{day} : {title}</li>'); ?>

到此归档页面已经创建完成,接著上传到主题目录,然后进入typecho后台新建page页面,然后选择模板为archives就可以了。

担心复制的代码有问题,提供文本下载:1.rar