我的帖子分为两类——一类定义了它们的类型,例如。article
或review
另一个定义了主题-tablets
,smartphones
,smartwatches
, 等
如何获取当前帖子主题的类别ID,即是否为tablet
, smartphone
或smartwatch
.
如果我这样做了get_the_category( $post->ID );
我想它会返回帖子所属的所有类别,但如何过滤掉article
或review
类别输出?
示例:PostABC
在类别中article
具有ID=1
和tablets
具有ID=10
如何在tablets
ID=10
类别中没有article
一