0
我想打印出類似這樣不能WordPress的
【類別】帖子標題
有了這個代碼與標題打印類別我得到這個錯誤
注意:Trying獲得非對象的財產....
這是電流輸出
[] Olá, mundo!
array(1) { [0]=> object(stdClass)#2068 (17) { ["term_id"]=> &int(3) ["name"]=> &string(5) "PT-PT" ["slug"]=> &string(5) "pt-pt" ["term_group"]=> int(0) ["term_taxonomy_id"]=> int(3) ["taxonomy"]=> string(8) "category" ["description"]=> &string(0) "" ["parent"]=> &int(0) ["count"]=> &int(1) ["object_id"]=> int(1) ["filter"]=> string(3) "raw" ["cat_ID"]=> &int(3) ["category_count"]=> &int(1) ["category_description"]=> &string(0) "" ["cat_name"]=> &string(5) "PT-PT" ["category_nicename"]=> &string(5) "pt-pt" ["category_parent"]=> &int(0) } }
謝謝你們!
將$ category [「name」]更改爲$ category [0] - > name –