编辑“WordPress:Template Tags/the time”
该编辑可以被撤销。 请检查下面的对比以核实您想要撤销的内容,然后发布下面的更改以完成撤销。
最后版本 | 您的文本 | ||
第1行: | 第1行: | ||
== Description == | |||
== 描述 == | == 描述 == | ||
Displays the time of the current post. This tag must be used within [[WordPress:The Loop]]. | |||
显示当前文章的发表时间。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。 | 显示当前文章的发表时间。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。 | ||
== Usage == | |||
%%% <?php the_time('d'); ?> %%% | |||
== 用法 == | == 用法 == | ||
%%% <?php | %%% <?php the_时间('d'); ?> %%% | ||
== Examples == | |||
=== Default Usage === | |||
== 例子 == | == 例子 == | ||
第11行: | 第23行: | ||
=== 默认用法 === | === 默认用法 === | ||
Displays the time using your WordPress defaults. | |||
使用WordPress默认设置,显示时间。 | 使用WordPress默认设置,显示时间。 | ||
<p>Time posted: <?php the_time(); ?></p> | <p>Time posted: <?php the_time(); ?></p> | ||
<p>Time posted: <?php the_时间(); ?></p> | |||
=== Time as AM/PM VS. 24H format=== | |||
===上午/下午标记的时间格式和24小时的时间格式=== | ===上午/下午标记的时间格式和24小时的时间格式=== | ||
Displays the time using the format parameter string <tt>'09:18 am'</tt> (ex: 10:36 pm). | |||
使用格式参数string <tt>'上午09:18 '</tt> (例如: 下午10:36)显示时间。 | 使用格式参数string <tt>'上午09:18 '</tt> (例如: 下午10:36)显示时间。 | ||
第22行: | 第42行: | ||
<p>Time posted: <?php the_time('g:i a'); ?></p> | <p>Time posted: <?php the_time('g:i a'); ?></p> | ||
-- | |||
<p>Time posted: <?php the_时间('g:i a'); ?></p> | |||
-- | |||
Displays the time using the 24 hours format parameter string <tt>'G:i'</tt> (ex: 17:52). | |||
使用24小时制时间格式参数string <tt>'G:i'</tt> (例如: 17:52)显示时间。 | 使用24小时制时间格式参数string <tt>'G:i'</tt> (例如: 17:52)显示时间。 | ||
<p>Time posted: <?php the_time('G:i'); ?></p> | <p>Time posted: <?php the_time('G:i'); ?></p> | ||
<p>Time posted: <?php the_时间('G:i'); ?></p> | |||
=== Date as Month Day, Year === | |||
===按年,月,日格式组合的日期 === | ===按年,月,日格式组合的日期 === | ||
以日期格式<tt>'F j, Y'</tt> (例如: 2004年12月2日),这个格式可以用来代替标签[[WordPress:Template Tags/the date| | Displays the time in the date format <tt>'F j, Y'</tt> (ex: December 2, 2004), which could be used to replace the tag [[WordPress:Template Tags/the date|the_date()]]. | ||
以日期格式<tt>'F j, Y'</tt> (例如: 2004年12月2日),这个格式可以用来代替标签[[WordPress:Template Tags/the date|the_日期()]]。 | |||
<div><?php the_time('F j, Y'); ?></div> | <div><?php the_time('F j, Y'); ?></div> | ||
<div><?php the_时间('F j, Y'); ?></div> | |||
=== Date and Time === | |||
=== 日期和时间 === | === 日期和时间 === | ||
Displays the date and time. | |||
显示日期和时间。 | 显示日期和时间。 | ||
<p>Posted: <?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?></p> | <p>Posted: <?php the_time('F j, Y'); ?> at <?php the_time('g:i a'); ?></p> | ||
<p>Posted: <?php the_时间('F j, Y'); ?> at <?php the_时间('g:i a'); ?></p> | |||
<div style="border:1px solid blue; width:50%; padding:10px">Posted: July 17, 2007 at 7:19 am</div> | |||
<div style="border:1px solid blue; width:50%; padding:10px">发表时间: 2007年7月17日上午 7:19 </div> | <div style="border:1px solid blue; width:50%; padding:10px">发表时间: 2007年7月17日上午 7:19 </div> | ||
== Parameters == | |||
== 参数 == | == 参数 == | ||
; d : (''string'') The format the time is to display in. Defaults to the time format configured in your WordPress options. See [[WordPress:Formatting Date and Time]]. | |||
; d : (''string'')显示时间的格式。默认为WordPress选项中设置的时间格式。请看看[[WordPress:Formatting Date and Time|日期和时间格式]]。 | ; d : (''string'')显示时间的格式。默认为WordPress选项中设置的时间格式。请看看[[WordPress:Formatting Date and Time|日期和时间格式]]。 | ||
== Related == | |||
{{Tag Date Tags}} | |||
{{Tag Footer}} | |||
== 相关的 == | == 相关的 == |