WordPress函数:get_the_term_list

一、get_the_term_list函数功能描述:

Returns an HTML string of taxonomy terms associated with a post and given taxonomy.Terms are linked to their respective term listing pages.

二、get_the_term_list函数语法:

三、get_the_term_list函数参数:

1、$id

(int) (required) Post ID

Default: None

2、$taxonomy

(string) (required) Name of taxonomy

Default: None

3、$before

(string) (optional) Leading text

Default: empty string

4、$sep

(string) (optional) String to separate tags

Default: empty string

5、$after

(string) (optional) Trailing text

Default: empty string

四、get_the_term_list函数返回数据:

(string)

HTML string of taxonomy terms.

(bool)

false if the post does not have any associated terms.

五、get_the_term_list函数用法举例:

1、基本用法

循环内调用Used inside the loop this outputs the terms from the people taxonomy for a specific post.

会输出类似下面的结构:

2、高级用法

循环内调用Used inside the loop this outputs the terms from the styles taxonomy for a specific post as an (x)html list.

会输出类似下面的结构,可以自定义css

AD:站点文章对你有帮助,可以选择去百度口碑好评下,还可以点击此处

赞 (1) 口碑
分享到:更多 ()

评论 2

评论前必须登录!

  1. 商学院
    看不懂,不过看得出很用心的写,支持下po主
  2. 龙笑天
    首页大变样啊~ :mrgreen: