0
分享

Tyepcho 自定义文章标签输出

网站代码 浏览 1.6K+ 评论 0

Typecho 默认标签输出:

$this->tags(', ', true, 'none');

以下代码放入 funcitons.php 文件中。

function oxcat_tags($obj) {
    if (count($obj->tags) > 0):
        foreach($obj->tags as $tag){
            echo '<a href="'.$tag['permalink'].'" class="tag" rel="category">'.$tag['name'].'</a>';
        }
    endif;
}

在模板相应位置用 <?php oxcat_tags($this); ?> 输出

评论

还没有评论,快来抢沙发吧!