來(lái)源于:
官方文檔:
https://codex.wordpress.org/Function_Reference/single_tag_title
https://www.beizigen.com/1618.html
WordPress模板標(biāo)簽single_tag_title輸出當(dāng)前標(biāo)簽(Tag)的標(biāo)題,一般用在標(biāo)簽頁(yè)。
single_tag_title( string $prefix = '', boolean $display = true )
函數(shù)參數(shù)
$prefix
字符串值,默認(rèn)為空
在標(biāo)題前輸出的字符
$display
布爾值,默認(rèn)值:true
是否輸出返回的值,默認(rèn)為輸出。
single_tag_title()函數(shù)使用示例
<p><?php single_tag_title('當(dāng)前標(biāo)簽:'); ?></p>
擴(kuò)展閱讀
single_tag_title()函數(shù)位于:wp-includes/general-template.php
描述
顯示或返回當(dāng)前存檔頁(yè)面的標(biāo)記標(biāo)題。
用法
?<?php?single_tag_title(?$prefix,?$display?);??>?
默認(rèn)用法
?<?php?single_tag_title();??>?
參數(shù)
$前綴
(字符串)(可選)在標(biāo)題之前輸出的文本。
默認(rèn)值:無(wú)
注意:如果$ display參數(shù)為false,則當(dāng)前忽略$ prefix參數(shù)。
見(jiàn)http://core.trac.wordpress.org/ticket/16632
$顯示
(boolean)(可選)顯示標(biāo)題(TRUE),或返回要在PHP中使用的標(biāo)題(FALSE)。
默認(rèn)值:TRUE
例子
此示例顯示文本“?當(dāng)前瀏覽?”,后跟標(biāo)記標(biāo)題。
<p> <?php single_tag_title('目前正在瀏覽'); ?> </ p>
目前正在瀏覽WordPress。
此示例將當(dāng)前標(biāo)記標(biāo)題分配給變量$ current_tag,以便在PHP中使用。
<?php $ current_tag = single_tag_title(“”,false); ?>
更改日志
源文件
single_tag_title()位于wp-includes/general-template.php
。
有關(guān)
標(biāo)簽:?get_tag(),?get_tag_link(),?get_tags(),?get_the_tag_list(),?get_the_tags(),?is_tag(),the_tags(),?single_tag_title(),?tag_description(),?wp_generate_tag_cloud(),?wp_tag_cloud()
另請(qǐng)參見(jiàn)函數(shù)參考索引和模板標(biāo)記索引。