更新时间:2023-02-14 21:19:04
您可以查询最近更新的帖子和页面,然后从中提取更新日期.尝试这样的事情.
You could query the most recently updated posts and pages, then pull out the updated date from there. Try something like this.
$recently_updated_posts = new WP_Query(array(
'post_type' => array('any'),
'posts_per_page' => 1
'orderby' => 'modified',
'no_found_rows' => true, // speed up query when we don't need pagination
));
然后,您可以在标准 WordPress 循环中使用 $recently_updated_posts
并访问 the_modified_date()
和 get_the_modified_date()
函数.
Then, you can use the $recently_updated_posts
in the standard WordPress loop and have access to the_modified_date()
and the get_the_modified_date()
functions.