目录
描述
The get_the_date template tag retrieves the date the current $post
was written. Unlike the_date() this tag will always return the date. Modify output with 'get_the_date' filter.
用法
<?php $pfx_date = get_the_date( $format, $post_id ); ?>
参数
$format
(string) (可选) PHP date format.
默认值: the date_format
option ('Date Format' on Settings > General panel)
$post
(integer) (可选) The ID of the post you'd like to fetch. By default the current post is fetched.
默认值: null
示例
Default Usage
1 2 3 4 |
/* ---------------------------------- * wordpress之魂 © http://wphun.com * ---------------------------------- */ <span class="entry-date"><?php echo get_the_date(); ?></span> |
- 原文:http://codex.wordpress.org/Function_Reference/get_the_date
- 翻译:黄聪@WordPress之魂