WordPress: Template Tags/single tag title:修订间差异

来自站长百科
跳转至: 导航、​ 搜索
无编辑摘要
无编辑摘要
 
第1行: 第1行:
== Description ==
== 描述 ==
== 描述 ==


Displays or returns the tag title for the current page.
显示或者返回当前网页的标签标题。
显示或者返回当前网页的标签标题。
== Usage ==
== 用法 ==
== 用法 ==


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


== 例子 ==
== 例子 ==


This example displays the text "'''Currently browsing '''" followed by the tag title.
这个例子显示了文本"'''当前浏览'''",后面是标签标题。
这个例子显示了文本"'''当前浏览'''",后面是标签标题。
&lt;p&gt;<?php single_tag_title('Currently browsing '); ?>.&lt;/p&gt;
<div style="border:1px solid blue; width:50%; padding:10px">Currently browsing WordPress.</div>
&lt;p&gt;<?php single_tag_title('Currently browsing '); ?>.&lt;/p&gt;
&lt;p&gt;<?php single_tag_title('Currently browsing '); ?>.&lt;/p&gt;


<div style="border:1px solid blue; width:50%; padding:10px">当前浏览WordPress。</div>
<div style="border:1px solid blue; width:50%; padding:10px">当前浏览WordPress。</div>
This example assigns the current tag title to the variable $current_tag for use in PHP.


这个例子将当前的标签标题递交到变数$current_tag,以供在PHP中使用。
这个例子将当前的标签标题递交到变数$current_tag,以供在PHP中使用。
<?php $current_tag = single_tag_title("", false); ?>


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


== 参数 ==
== 参数 ==


; prefix : (''string'') Text to output before the tag title. Defaults to <tt>&#39;&#39;</tt> (no text).
; prefix : (''string'') 标签标题之前的文本。默认为<tt>&#39;&#39;</tt> (没有文本)


;前缀:(''string'')标签标题之前的文本。默认为<tt>&#39;&#39;</tt> (没有文本)。
; display : (''boolean'') 显示标签的标题(<tt>TRUE</tt>)或者将标题返回用于PHP(<tt>FALSE</tt>)。默认为<tt>TRUE</tt>。
; display : (''boolean'') Display the tag's title (<tt>TRUE</tt>) or return it for use in PHP (<tt>FALSE</tt>). Defaults to <tt>TRUE</tt>.
;显示:(''boolean'')显示标签的标题(<tt>正确的</tt>)或者将标题返回用于PHP(<tt>错误的</tt>)。默认为<tt>正确的</tt>。
== Related ==


== 相关的 ==
== 相关的 ==
{{Tag Tag Tags}}
{{PHP Function Tag Footer}}


{{标签标签 标签}}
{{标签标签 标签}}


{{PHP函数标签页底文字}}
{{PHP函数标签页底文字}}

2008年7月19日 (六) 14:39的最新版本

描述[ ]

显示或者返回当前网页的标签标题。

用法[ ]

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

例子[ ]

这个例子显示了文本"当前浏览",后面是标签标题。 <p><?php single_tag_title('Currently browsing '); ?>.</p>

当前浏览WordPress。

这个例子将当前的标签标题递交到变数$current_tag,以供在PHP中使用。

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

参数[ ]

prefix
(string) 标签标题之前的文本。默认为'' (没有文本)。
display
(boolean) 显示标签的标题(TRUE)或者将标题返回用于PHP(FALSE)。默认为TRUE

相关的[ ]

模板:标签标签 标签