原主题的归档页面不是我的菜,而网上的归档插件,在我的博客了发神经,时好时坏,无奈之下,只好自己参照各种版本的教程,还有官网的wiki,整出一个这样的归档页面来,没有加载js,全部就是几行代码而已,喜欢的同学直接拿去,不谢!

<?php if (!defined('__TYPECHO_ROOT_DIR__')) exit; ?>
<?php
/**
* archives
*
* @package custom
*/
$this->need('header.php'); ?>
<div id="mainbox2">
<div class="post" id="post-<?php $this->cid(); ?>">
<h1><span class="post-title"><a href="<?php $this->permalink() ?>" title=""><?php $this->title() ?></a></span></h1>
<div class="clear"></div>
<div class="entry">
<?php $this->widget('Widget_Contents_Post_Recent', 'pageSize=10000')->to($archives);
$year=0; $mon=0; $i=0; $j=0;
$output = '<div class="post-content cf">';
while($archives->next()):
$year_tmp = date('Y',$archives->created);
$mon_tmp = date('m',$archives->created);
$y=$year; $m=$mon;
if ($mon != $mon_tmp && $mon > 0) $output .= '</ul></li>';
if ($year != $year_tmp && $year > 0) $output .= '</ul>';
if ($year != $year_tmp) {
$year = $year_tmp;
$output .= '<h3>'. $year .' 年</h3><ul>';
}
if ($mon != $mon_tmp) {
$mon = $mon_tmp;
$output .= '<li><span>'. $year .' 年'. $mon .' 月</span><ul>';
}
$output .= '<li>'.date('d日: ',$archives->created).'<a href="'.$archives->permalink .'">'. $archives->title .'</a> ('. $archives->commentsNum.')</li>';
endwhile;
$output .= '</ul></li></ul></div>';
echo $output;
?> <div class="clear"></div>
</div>
</div>
</div>
<?php $this->need('footer.php'); ?>另外把css美化一下,各位参照自己的主题动手修改,我的css如下:
div#mainbox2 {
position: relative;
margin: 9% auto 5%;
padding: 1% 3% 2%;
max-width: 800px;
width: 100%;
background-color: #fff;
-webkit-box-shadow: 1px 2px 3px #ddd;
box-shadow: 1px 2px 3px #ddd;
-webkit-border-radius: 3px;
border-radius: 3px;
}
会折腾的技术男……
可以直接粘贴用,不是插件,多了个选择~
插件要加载js,可能会拖慢打开速度
其实不需要翻页也可以的
恩,暂时就这样用着吧
不错,有按月归档的功能
就是不会设置翻页功能
官方论坛也有人提过需求,貌似没有修改方法
tp官方基本没有消息了,都是一群爱好者在折腾
建议还要考虑一个情况,比如有些博客文章太多,会导致崩溃,需要设置一个翻页。
翻页直接搞不来~囧
参考wp内置的nextpage函数
额, 我用的是typecho,回头去学习一下,看能不能搞起来
归档插件一直都可以用的。只是JQ要在顶部(插件需要JQ支持)
有时候加载不出来,神烦
哈哈,谢谢了
分享是互联网最基本的精神,哈
链接颜色有些深,感觉不大协调,或许可以考虑换一种颜色。
稍微调整了一写,对颜色的感觉太差了,:(