-
Notifications
You must be signed in to change notification settings - Fork 34
Expand file tree
/
Copy pathpage_articles_month.php
More file actions
42 lines (39 loc) · 1.41 KB
/
page_articles_month.php
File metadata and controls
42 lines (39 loc) · 1.41 KB
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
38
39
40
41
42
<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit;
/**
* 归档页面(按月分类)
*
* @package custom
*/
?>
<?php $this->need('header.php'); ?>
<section class="content-wrap">
<div class="layout">
<main class="layout__main">
<article id="arc" class="post">
<header class="post__head">
<div class="archive-tip">很好! 目前共计<strong><?php Typecho_Widget::widget('Widget_Stat')->to($stat)->publishedPostsNum(); ?></strong>篇文章,继续加油呀~</div>
</header>
<section class="post-content post__content">
<div id="archives" class="archive-list">
<?php $this->widget('Widget_Contents_Post_Recent', 'pageSize=10000')->to($archives);
$year=0; $mon=0; $output="";
while($archives->next()):
$year_tmp = date('Y',$archives->created);
$mon_tmp = date('m',$archives->created);
if ($mon != $mon_tmp) {
$year = $year_tmp;
$mon = $mon_tmp;
$output .= '<h2 class="archive-year">'. $year .' 年 '. intval($mon) .' 月</h2>'; //输出年月
}
$output .= '<div class="archive-item"><a class="archive-meta" href="'.$archives->permalink .'"><time>'.date('m/d',$archives->created).'</time>'. htmlspecialchars($archives->title) .'</a></div>';
endwhile;
echo $output;
?>
</div>
</section>
</article>
</main>
<?php $this->need('sidebar.php'); ?>
</div>
</section>
<?php $this->need('footer.php'); ?>