我试图在Wordpress中显示哪些类别属于某个特定的帖子。我只想展示属于catID 10的子级的类别,而不想展示孙级。这是代码,它现在显示了子代和孙代。 foreach((get_the_category()) as $childcat) {
if (cat_is_ancestor_of(10, $childcat)
我一直在努力从Wordpress中提取父类别的帖子。当我试图显示子类别的帖子时,wordpress查询也显示子类别的帖子。<?/get all the categories ( this function will return all categories for a post in an array)
$category= get_th