get_the_tag_list()获取所有的标签信息,并且以Html形式输出

目录

描述

Generates a HTML string of the tags associated with the current post. The name of each tag will be linked to the relevant 'tag' page. You can tell the function to put a string before and after all the tags, and in between each tag. Differently from get_the_category_list, this tag must be used inside The Loop.

get_the_tag_list() 描述

用法

 <?php $tag_list get_the_tag_list$before$sep$after ); ?> 

This function does not display anything - if you want to put it straight onto the page, you should use echo get_the_tag_list();. Alternatively, you can assign it to a variable for further use by using $foo = get_the_tag_list();.

The variables are all optional. You can use HTML inside each of the fields.

get_the_tag_list() 用法

参数

$before

(string) (可选) Leading text.

默认值: ' '

$sep

(string) (可选) String to separate tags.

默认值: ' '

$after

(string) (可选) Trailing text.

默认值: ' '

get_the_tag_list() 参数

历史

  • 添加于 版本: 2.3.0

get_the_tag_list() 历史

源文件

get_the_tag_list() 函数的代码位于 wp-includes/category-template.php.

get_the_tag_list() 源文件

相关