WordPress: Template Tags/single post title:修订间差异
来自站长百科
(新页面: == Description == Displays or returns the title of the post when on a single post page (permalink page). This tag can be useful for displaying post title...) |
无编辑摘要 |
||
第1行: | 第1行: | ||
== Description == | == Description == | ||
== 描述 == | |||
Displays or returns the title of the post when on a single post page ([[WordPress:Glossary#Permalink|permalink]] page). This tag can be useful for displaying post titles outside [[WordPress:The Loop]]. | Displays or returns the title of the post when on a single post page ([[WordPress:Glossary#Permalink|permalink]] page). This tag can be useful for displaying post titles outside [[WordPress:The Loop]]. | ||
当在一个只有一篇文章的网页上时([[WordPress:Glossary#Permalink|permalink]] 网页),显示或者返回文章标题。对于在[[WordPress:The Loop|The Loop]]外显示文章标题,这个标签非常有用。 | |||
== Usage == | == Usage == | ||
== 用法 == | |||
%%% <?php single_post_title('prefix', display); ?> %%% | |||
%%% <?php single_post_title('prefix', display); ?> %%% | %%% <?php single_post_title('prefix', display); ?> %%% | ||
== Example == | == Example == | ||
==例子 == | |||
<h2><?php single_post_title('Current post: '); ?></h2> | <h2><?php single_post_title('Current post: '); ?></h2> | ||
<div style="border:1px solid blue; width:50%; padding:10px">Current post: Single Post Title</div> | <div style="border:1px solid blue; width:50%; padding:10px">Current post: Single Post Title</div> | ||
<h2><?php single_post_title('Current post: '); ?></h2> | |||
<div style="border:1px solid blue; width:50%; padding:10px">当前文章:单一的文章的标题</div> | |||
== Parameters == | == Parameters == | ||
== 参数 == | |||
; prefix : (''string'') Text to place before the title. Defaults to <tt>''</tt>. | ; prefix : (''string'') Text to place before the title. Defaults to <tt>''</tt>. | ||
;前缀:(''string'')标题之前放置的文本。默认为<tt>''</tt>。 | |||
; display : (''boolean'') Should the title be displayed (<tt>TRUE</tt>) or returned for use in PHP (<tt>FALSE</tt>). Defaults to <tt>TRUE</tt>. | ; display : (''boolean'') Should the title be displayed (<tt>TRUE</tt>) or returned for use in PHP (<tt>FALSE</tt>). Defaults to <tt>TRUE</tt>. | ||
;显示:(''boolean'')标题应该显示(<tt>正确的</tt>)还是返回用在PHP中(<tt>错误的</tt>)。默认为<tt>正确的</tt>。 | |||
== Related == | == Related == | ||
== 相关的== | |||
{{Tag Post Tags}} | {{Tag Post Tags}} | ||
{{PHP Function Tag Footer}} | {{PHP Function Tag Footer}} | ||
{{标签文章标签}} | |||
{{PHP函数标签页底文字}} |
2008年7月9日 (三) 15:34的版本
Description
描述
Displays or returns the title of the post when on a single post page (permalink page). This tag can be useful for displaying post titles outside WordPress:The Loop.
当在一个只有一篇文章的网页上时(permalink 网页),显示或者返回文章标题。对于在The Loop外显示文章标题,这个标签非常有用。
Usage
用法
%%% <?php single_post_title('prefix', display); ?> %%%
%%% <?php single_post_title('prefix', display); ?> %%%
Example
例子
<h2><?php single_post_title('Current post: '); ?></h2>
Current post: Single Post Title
<h2><?php single_post_title('Current post: '); ?></h2>
当前文章:单一的文章的标题
Parameters
参数
- prefix
- (string) Text to place before the title. Defaults to ''.
;前缀:(string)标题之前放置的文本。默认为''。
- display
- (boolean) Should the title be displayed (TRUE) or returned for use in PHP (FALSE). Defaults to TRUE.
;显示:(boolean)标题应该显示(正确的)还是返回用在PHP中(错误的)。默认为正确的。
Related
相关的
模板:PHP Function Tag Footer the_ID, the_title, the_title_attribute, single_post_title, the_title_rss, the_content, the_content_rss, the_excerpt, the_excerpt_rss, previous_post_link, next_post_link, posts_nav_link, the_meta,