the_tags()

WordPress获取文章Tag函数

WordPress模板函数the_tags用于在文章页输出函数链接,必须用在The Loop主循环中。

the_tags( string $before = null, string $sep = ', ', string $after = '' )

函数参数

$before

字符串值,默认值:null

在函数链接前显示的文本。

$sep

字符串值,默认值:,

在每个函数链接之间显示的文本。

$after

字符串值,默认为空

在函数链接后显示的文本。

函数使用示例

以无序列表输出函数链接:

<ul>
	<?php the_tags('<li>', '</li><li>', '</li>') ?>
</ul>

扩展阅读

the_tags()函数位于:wp-includes/category-template.php

相关函数:

get_tag()
get_tag_link()
get_tags()
get_the_tag_list()
get_the_tags()
is_tag()
single_tag_title()
tag_description()
wp_generate_tag_cloud()
wp_tag_cloud()

0 条回复 A文章作者 M管理员
    暂无讨论,说说你的看法吧
个人中心
购物车
优惠劵
今日签到
有新私信 私信列表
搜索