WordPress: Template Tags/the weekday date:修订间差异
来自站长百科
无编辑摘要 |
无编辑摘要 |
||
第1行: | 第1行: | ||
{{取消的}} | {{取消的}} | ||
== 描述 == | == 描述 == | ||
当当前文章与前一篇文章不是在同一天发表的时候,显示当前文章是在星期几发表的(例如星期五)。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。 | 当当前文章与前一篇文章不是在同一天发表的时候,显示当前文章是在星期几发表的(例如星期五)。必须在[[WordPress:The Loop|The Loop]]内使用这个标签。 | ||
== 取代 == | == 取代 == | ||
拥有另一个标签的对等标签,因此,要替换,使用[[WordPress:Template_Tags/the_date|the_date()]]作为trigger,带有<tt>'l'</tt>(L的小写字母)[[WordPress:Template_Tags/the_time|the_time()]]作为格式字符串,就如这个PHP代码块中所显示的: | |||
<?php if(the_date('','','', FALSE)) the_time('l'); ?> | <?php if(the_date('','','', FALSE)) the_time('l'); ?> | ||
请看看[[WordPress:Formatting Date and Time|日期和时间格式]]关于格式字符串使用的日期和时间的信息。 | 请看看[[WordPress:Formatting Date and Time|日期和时间格式]]关于格式字符串使用的日期和时间的信息。 | ||
== 用法 == | == 用法 == | ||
%%% <?php the_weekday_date('before', 'after') ?> %%% | %%% <?php the_weekday_date('before', 'after') ?> %%% | ||
== 例子 == | == 例子 == | ||
<p>Posts from <?php the_weekday_date('<strong>', '</strong>') ?>:</p> | <p>Posts from <?php the_weekday_date('<strong>', '</strong>') ?>:</p> | ||
== 参数== | == 参数== | ||
; before : (''string'') | ; before : (''string'') 标签内容前面的文本。没有默认设置。 | ||
; after | ; after : (''string'') 放在标签内容之后的文本。没有默认设置。 | ||
== 相关的== | == 相关的== |
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) 放在标签内容之后的文本。没有默认设置。