WordPress: Template Tags/the modified date:修订间差异

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


This tag displays the date (and time) a post was last modified.  This tag works just like [[WordPress:Template_Tags/the_modified_time|the_modified_time()]], which also displays the time/date a post was last modified.  This tag must be used within [[WordPress:The Loop]].  If no format parameter is specified, the '''Default date format''' (please note that says Date format) setting from [[WordPress:Administration_Panels|Administration]] > [[WordPress:Administration_Panels#General|Settings]] > [[WordPress:Settings_General_SubPanel|General]] is used for the display format.
这个标签显示了文章最后一次更改的日期(和时间)。这个标签的运行方式与[[WordPress:Template_Tags/the_modified_time|the_modified_time()]]相似,同时也显示了最后更改的时间/日期。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。如果没有指定格式参数,[[WordPress:Administration_Panels|管理]] > [[WordPress:Administration_Panels#General|设置]] > [[WordPress:Settings_General_SubPanel|总的]] 中的'''默认时间格式'''(请注意显示时间格式的设置)设置用来显示时间格式。


这个标签显示了文章最后一次更改的日期(和时间)。这个标签的运行方式与[[WordPress:Template_Tags/the_modified_time|the_更改的_时间()]]相似,同时也显示了最后更改的时间/日期。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。如果没有指定格式参数,[[WordPress:Administration_Panels|管理]] > [[WordPress:Administration_Panels#General|设置]] > [[WordPress:Settings_General_SubPanel|总的]] 中的'''默认时间格式'''(请注意显示时间格式的设置)设置用来显示时间格式。


If the post or page is not yet modified, the modified date is the same as the creation date.
如果文章或者网页仍然没有更改,更改的日期仍然与创作日期相同。


如果文章或者网页仍然没有更改,更改的日期仍然与编成日期相同。
==用法 ==
 
== Usage ==


%%% <?php the_modified_date('d'); ?> %%%
%%% <?php the_modified_date('d'); ?> %%%
==用法 ==
%%% <?php the_更改的_日期('d'); ?> %%%
== Examples ==
=== Default Usage ===


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


=== 默认用法 ===
=== 默认用法 ===
Displays the date the post was last modified, using the '''Default date format''' setting (e.g. F j, Y) from [[WordPress:Administration_Panels|Administration]] > [[WordPress:Administration_Panels#General|Settings]] > [[WordPress:Settings_General_SubPanel|General]].


显示文章最后更改的日期,使用[[WordPress:Administration_Panels|管理]] > [[WordPress:Administration_Panels#General|设置]] > [[WordPress:Settings_General_SubPanel|总的]]中的'''默认日期格式''' 设置 (例如 F j, Y)。
显示文章最后更改的日期,使用[[WordPress:Administration_Panels|管理]] > [[WordPress:Administration_Panels#General|设置]] > [[WordPress:Settings_General_SubPanel|总的]]中的'''默认日期格式''' 设置 (例如 F j, Y)。


  &lt;p&gt;Last modified: <?php the_modified_date(); ?>&lt;/p&gt;
  &lt;p&gt;Last modified: <?php the_modified_date(); ?>&lt;/p&gt;
&lt;p&gt;最后更改的: <?php the_更改的_日期(); ?>&lt;/p&gt;


<div style="border:1px solid blue; width:50%; padding:10px">Last modified: December 2, 2006</div>
<div style="border:1px solid blue; width:50%; padding:10px">Last modified: December 2, 2006</div>
<div style="border:1px 固体蓝; width:50%; padding:10px">最后一个更改:2006年12月2日</div>
=== Date as Month Day, Year ===


=== 按年,月,日排列的日期===
=== 按年,月,日排列的日期===
Displays the last modified date in the date format <tt>'F j, Y'</tt> (ex: December 2, 2006).


用日期格式<tt>'F j, Y'</tt> (例如: 2006年12月2日)显示最后更改的日期。
用日期格式<tt>'F j, Y'</tt> (例如: 2006年12月2日)显示最后更改的日期。
&lt;div&gt;Last modified: <?php the_modified_date('F j, Y'); ?>&lt;/div&gt;


&lt;div&gt;最后一次更改: <?php the_modified_date('F j, Y'); ?>&lt;/div&gt;
&lt;div&gt;最后一次更改: <?php the_modified_date('F j, Y'); ?>&lt;/div&gt;
<div style="border:1px solid blue; width:50%; padding:10px">Last modified: December 2, 2006</div>


<div style="border:1px solid blue; width:50%; padding:10px">最后一次更改:2006年12月2日</div>
<div style="border:1px solid blue; width:50%; padding:10px">最后一次更改:2006年12月2日</div>
=== Date and Time ===


=== 日期和时间 ===
=== 日期和时间 ===
Displays the date and time.
显示日期和时间。
显示日期和时间。
  &lt;p&gt;Modified: <?php the_modified_date('F j, Y'); ?> at <?php the_modified_date('g:i a'); ?>&lt;/p&gt;
  &lt;p&gt;Modified: <?php the_modified_date('F j, Y'); ?> at <?php the_modified_date('g:i a'); ?>&lt;/p&gt;


&lt;p&gt;更改的: <?php the_更改的_日期('F j, Y'); ?> at <?php the_modified_date('g:i a'); ?>&lt;/p&gt;
<div style="border:1px solid blue; width:50%; padding:10px">Modified: December 2, 2006 at 10:36 pm</div>


<div style="border:1px solid blue; width:50%; padding:10px">更改的:2006年12月2日,下午 10:36 </div>
<div style="border:1px solid blue; width:50%; padding:10px">更改的:2006年12月2日,下午 10:36 </div>


== Parameters ==


== 参数 ==
== 参数 ==
; d : (''string'') The format the date is to display in.  Defaults to the date 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}}
== 相关的 ==
== 相关的 ==



2008年7月12日 (六) 14:55的最新版本

描述[ ]

这个标签显示了文章最后一次更改的日期(和时间)。这个标签的运行方式与the_modified_time()相似,同时也显示了最后更改的时间/日期。必须在The Loop内使用这个标签。如果没有指定格式参数,管理 > 设置 > 总的 中的默认时间格式(请注意显示时间格式的设置)设置用来显示时间格式。


如果文章或者网页仍然没有更改,更改的日期仍然与创作日期相同。

用法[ ]

%%% <?php the_modified_date('d'); ?> %%%

例子[ ]

默认用法[ ]

显示文章最后更改的日期,使用管理 > 设置 > 总的中的默认日期格式 设置 (例如 F j, Y)。

<p>Last modified: <?php the_modified_date(); ?></p>
Last modified: December 2, 2006

按年,月,日排列的日期[ ]

用日期格式'F j, Y' (例如: 2006年12月2日)显示最后更改的日期。

<div>最后一次更改: <?php the_modified_date('F j, Y'); ?></div>

最后一次更改:2006年12月2日

日期和时间[ ]

显示日期和时间。

<p>Modified: <?php the_modified_date('F j, Y'); ?> at <?php the_modified_date('g:i a'); ?></p>


更改的:2006年12月2日,下午 10:36


参数[ ]

d
(string)日期需要显示的格式。默认为WordPress选项中配置的日期格式。请看看日期和时间格式

相关的[ ]

模板:标签 日期 标签