Warning: file_get_contents(/data/phpspider/zhask/data//catemap/1/wordpress/11.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Wordpress 使用系统日期格式_Wordpress_Wordpress Theming - Fatal编程技术网

Wordpress 使用系统日期格式

Wordpress 使用系统日期格式,wordpress,wordpress-theming,Wordpress,Wordpress Theming,我有WordPress主题,我正在使用get_the_date函数获取帖子的发布日期: <?php echo get_the_date( 'M-d-y' ); ?> 但似乎最好使用get_选项“date_format” 如何使用“获取”选项功能显示发布后的日期?不需要使用“获取”选项来获取发布后的日期。您可以通过正确地使用get_和date函数来实现这一点 以下是解决方案: 将日期显示为2017年1月11日星期一,使用 要使日期显示为Wed Jan 9,请使用 阅读更多关于word

我有WordPress主题,我正在使用get_the_date函数获取帖子的发布日期:

<?php echo get_the_date( 'M-d-y' ); ?>
但似乎最好使用get_选项“date_format”

如何使用“获取”选项功能显示发布后的日期?

不需要使用“获取”选项来获取发布后的日期。您可以通过正确地使用get_和date函数来实现这一点

以下是解决方案:

将日期显示为2017年1月11日星期一,使用

要使日期显示为Wed Jan 9,请使用


阅读更多关于wordpress文档的信息,并在此处检查选项。

要检索发布数据还是检索当前发布日期?仅限发布日期
$post_date = get_the_date( 'l F j, Y' ); echo $post_date;
$post_date = get_the_date( 'D M j' ); echo $post_date;