get_the_date()获取当前文章/页面的发布日期

目录

描述

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.

get_the_date() 描述

用法

<?php $pfx_date get_the_date$format$post_id ); ?>

get_the_date() 用法

参数

$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

get_the_date() 参数

示例

Default Usage

get_the_date() 示例

相关