typecho的bytecats3模板增加杂项
typecho的bytecats3模板默认sidebar没有杂项,后台入口隐藏的比较深。如果需要显示杂项,需要修改以下两处:
1.在sidebar.php文件中“热门标签”对应代码后面增加:
<?php if (!empty($this->options->sidebarBlock) && in_array('ShowOther', $this->options->sidebarBlock)): ?>
<section class="widget">
<h3 class="widget-title"><?php _e('其它'); ?></h3>
<ul class="widget-list">
<?php if($this->user->hasLogin()): ?>
<li class="last"><a href="<?php $this->options->adminUrl(); ?>"><?php _e('进入后台'); ?> (<?php $this->user->screenName(); ?>)</a></li>
<li><a href="<?php $this->options->logoutUrl(); ?>"><?php _e('退出'); ?></a></li>
<?php else: ?>
<li class="last"><a href="<?php $this->options->adminUrl('login.php'); ?>"><?php _e('登录'); ?></a></li>
<?php endif; ?>
<li><a href="<?php $this->options->feedUrl(); ?>"><?php _e('文章 RSS'); ?></a></li>
</ul>
</section>
<?php endif; ?>
2.在functions.php文件中修改后台控制代码:
将原代码:
'ShowTags' => _t('显示标签')),
array('ShowSearch', 'ShowCategory', 'ShowRecentPosts', 'ShowArchive', 'ShowTags'), _t('侧边栏显示'));
修改为:
'ShowTags' => _t('显示标签'),
'ShowOther' => _t('显示其它杂项')),
array('ShowSearch', 'ShowCategory', 'ShowRecentPosts', 'ShowArchive', 'ShowTags', 'ShowOther'), _t('侧边栏显示'));