Skip to content

Commit

Permalink
侧边栏添加归档#20
Browse files Browse the repository at this point in the history
  • Loading branch information
hongweipeng committed Dec 12, 2019
1 parent ae3a610 commit 61f0663
Show file tree
Hide file tree
Showing 2 changed files with 13 additions and 0 deletions.
1 change: 1 addition & 0 deletions functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,7 @@ function themeConfig($form) {
'SidebarHiddenInDetail' => _t('文章页隐藏侧边栏'),
'HeaderHiddenInDetail' => _t('文章页隐藏顶部头像'),
'ShowCategory' => _t('侧边栏显示分类'),
'ShowArchive' => _t('侧边栏显示文档'),
),
array('ShowPostBottomBar'), _t('显示设置'));
$form->addInput($showBlock->multiMode());
Expand Down
12 changes: 12 additions & 0 deletions sidebar.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,6 +55,18 @@
</div>
</aside>
<?php endif; ?>
<?php if (!empty($this->options->ShowBlock) && in_array('ShowArchive', $this->options->ShowBlock)): ?>
<aside>
<div class="card card-skin hidden-xs">
<div class="card-header"><i class="fa fa-book fa-fw"></i> <?php _e('归档'); ?></div>
<div class="list-group category">
<ul class="widget-list">
<?php $this->widget('Widget_Contents_Post_Date', 'type=month&format=Y 年 m 月')->parse('<li><a href="{permalink}">{date}<span class="badge badge-secondary float-right">{count}</span></a></li>'); ?>
</ul>
</div>
</div>
</aside>
<?php endif; ?>
<div id="fixed"></div>
<aside class="fixsidebar">
<div class="card card-skin hidden-xs">
Expand Down

0 comments on commit 61f0663

Please sign in to comment.