我找到了一个糟糕的解决方案,但它对我有效。如果有人想改进这段代码或有更好的解决方案,我将不胜感激。
$user_id = get_current_user_id();
$args=array(
\'post_type\' => \'post\',
\'post_status\' => \'published\',
\'posts_per_page\' => 1,
\'ignore_sticky_posts\' => 1,
\'author\' => $user_id
);
$wp_query = new WP_Query($args);
while ( have_posts() ) : the_post();
echo the_title();
echo get_the_time(\'Y-m-d\', $post->ID);
endwhile;