首页 WordPress函数大全 get_the_category()

get_the_category()

2020-05-01 / 5327阅 / 悠然

如何你看完本文还不知道如何使用该函数,可以联系我定制视频教程,50元/个函数,学不会全额退款

get_the_category( int $id = false )

Retrieve post categories.

描述

This tag may be used outside The Loop by passing a post id as the parameter.

Note: This function>get_the_terms().

参数

$id

(int)
(Optional)
default to current post ID. The post ID.

Default value: false

返回

(WP_Term[]) Array of WP_Term objects, one for each category assigned to the post.

大家谈论
    我的见解