默认的echo 参数为true 对于wp_get_archives(). 我认为这会解决问题:
// One Recent Post
function most_recent_post_shortcode() {
return wp_get_archives( \'type=postbypost&limit=1&format=custom&echo=0\');
}
add_shortcode( \'recent-post\', \'most_recent_post_shortcode\' );
更新:以前:echo=false现在:echo=0