the_category

過濾鉤子
apply_filters( 'the_category', get_cat_name( get_option( 'default_category' )

the_category是一個模板標籤,顯示分配給一個文章的類別的名稱。它通常用於在文章後設資料或文章內容本身中顯示類別。

這個過濾器在wp-includes/category-template.php中有記錄。

Plain text
Copy to clipboard
Open code in new window
EnlighterJS 3 Syntax Highlighter
'<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category' ) ), '', '' ) . '</strong>'
'<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category' ) ), '', '' ) . '</strong>'
'<strong>' . apply_filters( 'the_category', get_cat_name( get_option( 'default_category' ) ), '', '' ) . '</strong>'

常見問題

FAQs
檢視更多 >