2011-02-04 40 views

回答

1

它是正確的。正如get_the_terms()的法典頁面中所報告的,返回一組術語。 然後,您可以稍後在代碼中使用該數組。

<?php 
    $terms = get_the_terms(); 
    print_r($terms) 
?> 

發現條款的結構。

本示例打印出由函數檢索的術語的名稱。

foreach ($terms as $term) { 
echo $term->name 
} 
0

稍微偏離主題,但就在昨天我過上wordpress.stackexchange.com回答了question related to this。它發現了一些關於「獲得與某篇文章相關的分類法/術語」的主題。