Home  >  Article  >  Backend Development  >  如何在typecho中的文章页面获得当前页面分类的缩略名??

如何在typecho中的文章页面获得当前页面分类的缩略名??

WBOY
WBOYOriginal
2016-06-06 20:46:441820browse

如题。如何在typecho中的文章页面获得当前页面分类的缩略名??还有当前分类的名称

回复内容:

如题。如何在typecho中的文章页面获得当前页面分类的缩略名??还有当前分类的名称

楼上不够简洁

<code class="lang-php">// 当前分类缩略名
echo $this->category;

// 当前分类名
$this->category(',', false);
</code>

<code>$categories = $this->categories;
foreach($categories as $cate) {
    echo $cate['slug'];
    echo $cate['name'];
}
</code>

应该是这样的..

Statement:
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn