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

来自站长百科
跳转至: 导航、​ 搜索
无编辑摘要
无编辑摘要
 
第1行: 第1行:
{{Deprecated}}
== Description ==
{{取消的}}
{{取消的}}
== 描述 ==
== 描述 ==
Displays the weekday of the current post (e.g. Friday) only if it is different from the weekday of the previous post. This tag must be used within [[WordPress:The Loop]].


当当前文章与前一篇文章不是在同一天发表的时候,显示当前文章是在星期几发表的(例如星期五)。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。
当当前文章与前一篇文章不是在同一天发表的时候,显示当前文章是在星期几发表的(例如星期五)。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。
== Replace With ==


== 取代 ==
== 取代 ==


There is one-to one correspondence with another template tag, so to replace, use [[WordPress:Template_Tags/the_date|the_date()]] as a trigger and [[WordPress:Template_Tags/the_time|the_time()]] with <tt>'l'</tt> (lowercase letter L) as the format string, as shown in this PHP code block:
拥有另一个标签的对等标签,因此,要替换,使用[[WordPress:Template_Tags/the_date|the_date()]]作为trigger,带有<tt>'l'</tt>(L的小写字母)[[WordPress:Template_Tags/the_time|the_time()]]作为格式字符串,就如这个PHP代码块中所显示的:
 
拥有另一个标签的对等标签,因此,要替换,使用[[WordPress:Template_Tags/the_date|the_日期()]]作为trigger,带有有<tt>'l'</tt>(L的小写字母)[[WordPress:Template_Tags/the_time|the_时间()]]作为格式字符串,就如这个PHP代码块中所显示的:


  <?php if(the_date(&#39;&#39;,&#39;&#39;,&#39;&#39;, FALSE)) the_time('l'); ?>
  <?php if(the_date(&#39;&#39;,&#39;&#39;,&#39;&#39;, FALSE)) the_time('l'); ?>
<?php if(the_date(&#39;&#39;,&#39;&#39;,&#39;&#39;, FALSE)) the_时间('l'); ?>
See [[WordPress:Formatting Date and Time]] for information on date and time format string use.


请看看[[WordPress:Formatting Date and Time|日期和时间格式]]关于格式字符串使用的日期和时间的信息。
请看看[[WordPress:Formatting Date and Time|日期和时间格式]]关于格式字符串使用的日期和时间的信息。
== Usage ==


== 用法 ==
== 用法 ==


%%% <?php the_weekday_date('before', 'after') ?> %%%
%%% <?php the_weekday_date('before', 'after') ?> %%%
%%% <?php the_星期几_日期('之前', '之后') ?> %%%
== Example ==


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


  &lt;p&gt;Posts from <?php the_weekday_date('&lt;strong&gt;', '&lt;/strong&gt;') ?>:&lt;/p&gt;
  &lt;p&gt;Posts from <?php the_weekday_date('&lt;strong&gt;', '&lt;/strong&gt;') ?>:&lt;/p&gt;
&lt;p&gt;文章来自 <?php the_weekday_date('&lt;strong&gt;', '&lt;/strong&gt;') ?>:&lt;/p&gt;
== Parameters ==


== 参数==
== 参数==


; before : (''string'') Text placed before the tag's output. There is no default.
; before : (''string'') 标签内容前面的文本。没有默认设置。
; after : (''string'') Text placed after the tag's output. There is no default.
; after : (''string'') 放在标签内容之后的文本。没有默认设置。
 
; 之前: (''string'') 标签内容前面的文本。没有默认设置。
; 之后 : (''string'') 放在标签内容之后的文本。没有默认设置。
 
== Related ==
 
{{Tag Date Tags}}
 
{{PHP Function Tag Footer}}


== 相关的==
== 相关的==

2008年7月12日 (六) 17:26的最新版本


This function has been deprecated. That means it has been replaced by a new function or is no longer supported, and may be removed from future versions. All code that uses this function should be converted to use its replacement if one exists.


描述[ ]

当当前文章与前一篇文章不是在同一天发表的时候,显示当前文章是在星期几发表的(例如星期五)。必须在The Loop内使用这个标签。

取代[ ]

拥有另一个标签的对等标签,因此,要替换,使用the_date()作为trigger,带有'l'(L的小写字母)the_time()作为格式字符串,就如这个PHP代码块中所显示的:

<?php if(the_date('','','', FALSE)) the_time('l'); ?>

请看看日期和时间格式关于格式字符串使用的日期和时间的信息。

用法[ ]

%%% <?php the_weekday_date('before', 'after') ?> %%%

例子[ ]

<p>Posts from <?php the_weekday_date('<strong>', '</strong>') ?>:</p>

参数[ ]

before
(string) 标签内容前面的文本。没有默认设置。
after
(string) 放在标签内容之后的文本。没有默认设置。

相关的[ ]

模板:标签 日期 标签