[英]Get tags for a specific post type
I'm trying to query the WordPress database to get the post tags for a specific post type. 我正在尝试查询WordPress数据库以获取特定帖子类型的帖子标签。
So far I have this, which is giving me all the tags, but I'm not sure how to limit this to a specific post type, or if that is possible. 到目前为止,我已经有了它,为我提供了所有标签,但是我不确定如何将其限制为特定的帖子类型,或者是否可行。
$query = "SELECT name FROM wp_terms";
$myrows = $wpdb->get_results( $query );
foreach ( $myrows as $myrow )
{
print_r($myrow);
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.