单独输出tag链接地址

8次阅读

可以单独输出 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); ?>

正文完