2012年7月30日 星期一

wordpress顯示分類標題或slug(category name)


在single.php裡這樣用
<?php
$category = get_the_category();
echo $category[0]->slug ;
?>
在category.php裡這樣用
$current_category = single_cat_title("", false);

沒有留言:

張貼留言