模板标签-single_tag_title()

0条评论

说明

该标签显示或返回当前页面的标签标题。

用法

<?php single_tag_title( $prefix, $display ); ?> 

默认用法

 <?php single_tag_title(
    'prefix'   => , 
    'display'  => true ); ?> 

参数

$prefix

(字符串)(可选)输出时在标题前的文本信息。

默认值:None

$display

(布尔型)(可选)显示标题(TRUE)或返回标题以便用在PHP中(FALSE)。

默认值:TRUE

示例

下面这个例子在标签标题后显示“Currently browsing ”(当前正浏览)字样:

<p><?php single_tag_title('Currently browsing '); ?>.</p>  

下面这个例子将当前标签标题赋值给变量$current_tag以用在PHP中。

<?php $current_tag = single_tag_title("", false); ?>  

历史记录

始见于WordPress 2.3.0版本。

发表新评论

此内容将保密,不会被其他人看见。
  • 自动将网址与电子邮件地址转变为链接。
  • 允许HTML标签:<a> <em> <strong> <cite> <code> <ul> <ol> <li> <dl> <dt> <dd>
  • 自动断行和分段。

更多关於格式化选项的信息

CAPTCHA
This question is for testing whether you are a human visitor and to prevent automated spam submissions.
Image CAPTCHA
Enter the characters shown in the image.