单独输出tag链接地址

yibin 2015-04-27 Typecho 550

可以单独输出tag地址,需要修改funcations.php文件

function tags($widget, $split = ',', $default = NULL)
{
    /** 取出tags */
    if ($widget->tags) {
        $result = array();
        foreach ($widget->tags as $tag) {
            $result[] = $tag['permalink'];
        }

        echo implode($split, $result);
    } else {
        echo $default;
    }
}

调用

<?php tags($this); ?>

扫码添加微信

13013082126 扫描微信 建站咨询 优化咨询