• 赤色のリンクは、まだ日本語Codexに存在しないページ・画像です。英語版と併せてご覧ください。(詳細

このWikiはいつでも誰でも編集できます

「テンプレートタグ/the modified time」の版間の差分

提供: WordPress Codex 日本語版
移動先: 案内検索
(en:Template Tags/the_modified_time 2007年4月17日 (火) 13:39 MichaelH 版/MichaelH, TomK32 著)
 
(ページ体裁・リンク調整、未翻訳)
1行目: 1行目:
== Description ==
+
{{NeedTrans}}
  
This tag displays the time (and date) a post was last modified and is similar to the functionality of [[Template_Tags/the_time|the_time()]], which displays the time (and date) a post was created.  This tag must be used within [[The Loop]].  If no format parameter is specified, the '''Default date format''' (please note that says Date format) setting from [[Administration_Panels|Administration]] > [[Administration_Panels#General|Options]] > [[General_Options_SubPanel|General]] is used for the display format.
+
<div id="Description">
 +
== 説明 ==
 +
</div>
 +
 
 +
This tag displays the time (and date) a post was last modified and is similar to the functionality of [[テンプレートタグ/the_time|the_time()]], which displays the time (and date) a post was created.  This tag must be used within [[The Loop]].  If no format parameter is specified, the '''Default date format''' (please note that says Date format) setting from [[管理パネル|Administration]] > [[管理パネル#General|Options]] > [[General_Options_SubPanel|General]] is used for the display format.
  
 
If the post or page is not yet modified, the modified time is the same as the creation time.
 
If the post or page is not yet modified, the modified time is the same as the creation time.
7行目: 11行目:
 
If you want to display both the modified time and the creation time, you may want to use an <tt>if</tt> statement (e.g. <tt>if (get_the_modified_time() != get_the_time())</tt>) to avoid showing the same time/date twice.
 
If you want to display both the modified time and the creation time, you may want to use an <tt>if</tt> statement (e.g. <tt>if (get_the_modified_time() != get_the_time())</tt>) to avoid showing the same time/date twice.
 
   
 
   
== Usage ==
+
<div id="Usage">
 +
== 使い方 ==
 +
</div>
  
%%% <?php the_modified_time('d'); ?> %%%
+
<?php the_modified_time('d'); ?>
  
== Examples ==
+
<div id="Examples">
 +
== 用例 ==
 +
</div>
  
=== Default Usage ===
+
<div id="Default_Usage">
 +
=== 初期設定での使用 ===
 +
</div>
  
Displays the time (date) the post was last modified, using the '''Default date format''' setting (e.g. F j, Y) from [[Administration_Panels|Administration]] > [[Administration_Panels#General|Options]] > [[General_Options_SubPanel|General]].
+
Displays the time (date) the post was last modified, using the '''Default date format''' setting (e.g. F j, Y) from [[管理パネル|Administration]] > [[管理パネル#General|Options]] > [[General_Options_SubPanel|General]].
  
 
  &lt;p&gt;Last modified: <?php the_modified_time(); ?>&lt;/p&gt;
 
  &lt;p&gt;Last modified: <?php the_modified_time(); ?>&lt;/p&gt;
  
<div style="border:1px solid blue; width:50%; padding:10px">Last modified: December 2, 2006</div>
+
<div class="example">Last modified: December 2, 2006</div>
  
 +
<div id="Time_in_the_12-hour_format_.28am.2Fpm.29">
 
=== Time in the 12-hour format (am/pm)===
 
=== Time in the 12-hour format (am/pm)===
 +
</div>
  
 
If a post was modified at 10:36pm, this example displays the time the post was last modified using the 12-hour format parameter string <tt>'g:i a'</tt>.
 
If a post was modified at 10:36pm, this example displays the time the post was last modified using the 12-hour format parameter string <tt>'g:i a'</tt>.
27行目: 39行目:
 
  &lt;p&gt;Time last modified: <?php the_modified_time('g:i a'); ?>&lt;/p&gt;
 
  &lt;p&gt;Time last modified: <?php the_modified_time('g:i a'); ?>&lt;/p&gt;
  
<div style="border:1px solid blue; width:50%; padding:10px">Time last modified: 10:36 pm</div>
+
<div class="example">Time last modified: 10:36 pm</div>
  
 +
<div id="Time_in_the_24-hour_format">
 
=== Time in the 24-hour format ===
 
=== Time in the 24-hour format ===
 +
</div>
 
If a post was modified at 10:36pm, this example displays the time the post was last modified using the 24-hour format parameter string <tt>'G:i'</tt>.
 
If a post was modified at 10:36pm, this example displays the time the post was last modified using the 24-hour format parameter string <tt>'G:i'</tt>.
  
 
  &lt;p&gt;Time last modified: <?php the_modified_time('G:i'); ?>&lt;/p&gt;
 
  &lt;p&gt;Time last modified: <?php the_modified_time('G:i'); ?>&lt;/p&gt;
  
<div style="border:1px solid blue; width:50%; padding:10px">Time last modified: 22:36</div>
+
<div class="example">Time last modified: 22:36</div>
  
 +
<div id="Date_as_Month_Day.2C_Year">
 
=== Date as Month Day, Year ===
 
=== Date as Month Day, Year ===
 +
</div>
  
Displays the last modified time and date in the date format <tt>'F j, Y'</tt> (ex: December 2, 2006), which could be used to replace the tag [[Template_Tags/the_modified_date|the_modified_date()]].  
+
Displays the last modified time and date in the date format <tt>'F j, Y'</tt> (ex: December 2, 2006), which could be used to replace the tag [[テンプレートタグ/the_modified_date|the_modified_date()]].  
  
 
  &lt;div&gt;Last modified: <?php the_modified_time('F j, Y'); ?>&lt;/div&gt;
 
  &lt;div&gt;Last modified: <?php the_modified_time('F j, Y'); ?>&lt;/div&gt;
  
<div style="border:1px solid blue; width:50%; padding:10px">Last modified: December 2, 2006</div>
+
<div class="example">Last modified: December 2, 2006</div>
  
 +
<div id="Date_and_Time">
 
=== Date and Time ===
 
=== Date and Time ===
 +
</div>
  
 
Displays the date and time.
 
Displays the date and time.
50行目: 68行目:
 
  &lt;p&gt;Modified: <?php the_modified_time('F j, Y'); ?> at <?php the_modified_time('g:i a'); ?>&lt;/p&gt;
 
  &lt;p&gt;Modified: <?php the_modified_time('F j, Y'); ?> at <?php the_modified_time('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 class="example">Modified: December 2, 2006 at 10:36 pm</div>
  
== Parameters ==
+
<div id="Parameters">
 +
== パラメータ ==
 +
</div>
  
 
; d : (''string'') The format the time is to display in.  Defaults to the date format configured in your WordPress options.  See [[Formatting Date and Time]].
 
; d : (''string'') The format the time is to display in.  Defaults to the date format configured in your WordPress options.  See [[Formatting Date and Time]].
  
== Related ==
+
== 変更履歴 ==
 +
* [[Version 2.1|2.1]] : 新規テンプレートタグ
 +
 
 +
<div id="Related">
 +
== 関連 ==
 +
</div>
  
 
{{Tag Date Tags}}
 
{{Tag Date Tags}}
62行目: 87行目:
 
{{Tag Footer}}
 
{{Tag Footer}}
  
[[Category:New page created]]
+
{{原文|Template Tags/the_modified_time|50243}}
 +
 
 +
{{DEFAULTSORT:the_modified_time}}
 +
[[Category:wp2.1]]
 +
 
 +
[[en:Template Tags/the_modified_time]]

2008年4月1日 (火) 03:33時点における版

このページ「テンプレートタグ/the modified time」は未翻訳です。和訳や日本語情報を加筆してくださる協力者を求めています

This tag displays the time (and date) a post was last modified and is similar to the functionality of the_time(), which displays the time (and date) a post was created. This tag must be used within The Loop. If no format parameter is specified, the Default date format (please note that says Date format) setting from Administration > Options > General is used for the display format.

If the post or page is not yet modified, the modified time is the same as the creation time.

If you want to display both the modified time and the creation time, you may want to use an if statement (e.g. if (get_the_modified_time() != get_the_time())) to avoid showing the same time/date twice.

使い方

<?php the_modified_time('d'); ?>

用例

初期設定での使用

Displays the time (date) the post was last modified, using the Default date format setting (e.g. F j, Y) from Administration > Options > General.

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

Time in the 12-hour format (am/pm)

If a post was modified at 10:36pm, this example displays the time the post was last modified using the 12-hour format parameter string 'g:i a'.

<p>Time last modified: <?php the_modified_time('g:i a'); ?></p>
Time last modified: 10:36 pm

Time in the 24-hour format

If a post was modified at 10:36pm, this example displays the time the post was last modified using the 24-hour format parameter string 'G:i'.

<p>Time last modified: <?php the_modified_time('G:i'); ?></p>
Time last modified: 22:36

Date as Month Day, Year

Displays the last modified time and date in the date format 'F j, Y' (ex: December 2, 2006), which could be used to replace the tag the_modified_date().

<div>Last modified: <?php the_modified_time('F j, Y'); ?></div>
Last modified: December 2, 2006

Date and Time

Displays the date and time.

<p>Modified: <?php the_modified_time('F j, Y'); ?> at <?php the_modified_time('g:i a'); ?></p>
Modified: December 2, 2006 at 10:36 pm

パラメータ

(string) The format the time is to display in. Defaults to the date format configured in your WordPress options. See Formatting Date and Time.

変更履歴

  • 2.1 : 新規テンプレートタグ


日時に関連するタグ: get_calendar(), get_day_link(), get_month_link(), get_the_date(), get_the_time(), get_year_link(), single_month_title(), the_date(), the_date_xml(), the_modified_date(), get_the_modified_date(), the_modified_time(), get_the_modified_time(), the_time()


関数リファレンステンプレートタグ目次もご覧ください。


最新英語版: WordPress Codex » Template Tags/the_modified_time最新版との差分