Typecho默认是没有归档页面,我们可以通过简单的操作,自己增加一个。

  1. 在主题文件夹新建一个页面,命名为“archives.php”,代码如下(注意下方代码区域有滚动):

    <?php   
    /**  
    * archives  
    *  
    * @package custom  
    */  
    $this->need('header.php'); ?>  
    <div class="col-mb-12 col-8" id="main" role="main">
    <article class="post" itemscope itemtype="http://schema.org/BlogPosting">
        <h1 class="post-title" itemprop="name headline">
            <a itemprop="url"
               href="<?php $this->permalink() ?>"><?php $this->title() ?></a>
        </h1>
        <div class="post-content" itemprop="articleBody">
           <?php $this->widget('Widget_Contents_Post_Recent', 'pageSize=10000')->parse('<li>{year}-{month}-{day} : <a href="{permalink}" target=_blank>{title}</a></li>'); ?>
        </div>
    </article>
    <?php $this->need('comments.php'); ?>
    </div><!-- end #main-->
    <?php $this->need('sidebar.php'); ?>
    <?php $this->need('footer.php'); ?>
  2. 新建独立页面,自定义模板处选择“archives”。

标签: none

仅有一条评论

  1. 搬走了

添加新评论