直接用Widget_Contents_Post_Recent来查找所有的文章,然后对文章进行分批显示即可

1.首先在主题根目录下建立一个自定义模板

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
<?php
/**
* dateTree
*
* @package custom
* Created by IntelliJ IDEA.
* User: SVz7
* Date: 2017/2/6
* Time: 1:05
*/
if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php $this->need('inc/header.php'); ?>

<div class="col-mb-12 col-12" id="main" role="main">
<div class="datetree" style="padding-top: 15px">
<?php $this->widget('Widget_Contents_Post_Recent', 'pageSize=10000')->to($arc);
$date=0;
while($arc->next()):
$date_tmp = date('Y m',$arc->created);
if ($date != $date_tmp && $date > 0) $output .= '</ul></div>';
if ($date != $date_tmp) {
$date = $date_tmp;
$output .= '<div class="widget">';
$output .= '<h3 style="text-align: center">'. $date .' </h3>';
$output .= '<ul>';
}
$output .= '<li>'.date('m/d',$arc->created).'&nbsp;&nbsp;&nbsp;&nbsp;<a href="'.$arc->permalink .'">'. $arc->title .'</a></li>';
endwhile;
$output .= '</ul>';
$output .= '</div>';
echo $output;
?>
</div>
</div><!-- end #main-->

<?php $this->need('inc/footer.php'); ?>


$date_tmp的格式对应归档方式,如以年份归档的话
1
$date_tmp = date('Y',$arc->created);

2.然后新建一个静态页面,模板选对应的自定义模板即可