WordPress: Template Tags/the title:修订间差异
来自站长百科
无编辑摘要 |
无编辑摘要 |
||
第1行: | 第1行: | ||
== 描述 == | == 描述 == | ||
显示或者返回当前文章的标题。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。 | 显示或者返回当前文章的标题。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。 | ||
== 用法 == | == 用法 == | ||
%%% <?php the_title('before', 'after', display); ?> %%% | %%% <?php the_title('before', 'after', display); ?> %%% | ||
==例子 == | ==例子 == | ||
<?php the_title('<h3>', '</h3>'); ?> | <?php the_title('<h3>', '</h3>'); ?> | ||
== 参数 == | == 参数 == | ||
; before | ; before : (''string'')标题之前放置的文本。默认为<tt>''</tt>。 | ||
; after : (''string'') | ; after : (''string'') 标题之后放置的文本。默认为<tt>''</tt>。 | ||
; display : (''Boolean'') 显示标题(<tt>TRUE</tt>)或者将标题返回,用在PHP中(<tt>FALSE</tt>)。默认为<tt>TRUE</tt>。 | |||
== 相关的== | == 相关的== | ||
也看看[[WordPress:Template_Tags/the_title_attribute|the_title_attribute()]]。 | 也看看[[WordPress:Template_Tags/the_title_attribute|the_title_attribute()]]。 | ||
{{标签文章标签}} | {{标签文章标签}} | ||
{{PHP函数标签页底文字}} | {{PHP函数标签页底文字}} |
2008年7月17日 (四) 10:59的最新版本
描述[ ]
显示或者返回当前文章的标题。必须在The Loop内使用这个标签。
用法[ ]
%%% <?php the_title('before', 'after', display); ?> %%%
例子[ ]
<?php the_title('<h3>', '</h3>'); ?>
参数[ ]
- before
- (string)标题之前放置的文本。默认为''。
- after
- (string) 标题之后放置的文本。默认为''。
- display
- (Boolean) 显示标题(TRUE)或者将标题返回,用在PHP中(FALSE)。默认为TRUE。
相关的[ ]
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,