且构网

分享程序员开发的那些事...
且构网 - 分享程序员编程开发的那些事

按日期元数据自定义字段删除Wordpress中的过期帖子

更新时间:2021-08-24 22:19:21

the_date()需要在循环中使用。在循环外部,它将返回null。改为使用 current_time()

the_date() needs to be used within the Loop. Outside the Loop, it will return null. Use current_time() instead.

$todays_date = current_time('mysql'); // returns YYYY-MM-DD HH:MM:SS