diff --git a/wp-includes/classes.php b/wp-includes/classes.php index 80c51ae14a..e3d5144a14 100644 --- a/wp-includes/classes.php +++ b/wp-includes/classes.php @@ -269,6 +269,10 @@ class WP { function query_posts() { global $wp_the_query; $this->build_query_string(); + if( $this->did_permalink && $this->query_vars['error'] == '404' ){ + $wp_the_query->parse_query($query); + return; + } $wp_the_query->query($this->query_vars); }