您当前位置: 首页 » php » php » wordpress » wordpress 根据文章ID获取分类ID和标签ID

wordpress 根据文章ID获取分类ID和标签ID

2015年10月29日 | 蒙奇·D·撸码客 发表评论(0) 查看评论

//wordpress 根据文章ID获取分类ID

$category=get_the_category( $post_ID );
$len= count($category);
for($i=0;$i<$len;$i++){
$catid[] =$category[$i]->term_id;
}

print_r( $catid );

//wordpress 根据文章ID获取标签ID
$tags=wp_get_post_tags( $post_ID );

$len= count($ tags );
for($i=0;$i<$len;$i++){
$tagid[] =$ tags [$i]->term_id;
}

print_r( $ tagid );


php,wordpress内容推荐

分类:

php

| 标签:

发表评论?

0 条评论。

发表评论