typecho另一种方法实现tagcloud

前些天,写过一篇关于Typecho tag cloud的文章https://mrasong.com/a/typecho-tagcloud,那时没深入了解typecho,有点走弯路。
其实可以用typecho的widget来快速实现tag cloud和archives,代码如下:

<?php 
/**
 * _Tag Cloud_
 * 
 * @package custom 
 * 
 */
?>
<?php  /*your code here*/  ?>

    <?php  /*archives   */  ?>
    <?php $this->widget('Widget_Contents_Post_Date', 'type=month&format=Y F')
            ->parse('<a href="{permalink}">{date}[{count}]</a>'); ?>

    <?php  /*tag cloud*/  ?>
    <?php $this->widget('Widget_Metas_Tag_Cloud')
            ->parse('<a href="{permalink}">{name}[{count}]</a>'); ?>

<?php  /*your code here*/  ?>

 效果见http://mrasong.com/archives/

添加新评论