From 321845ffcd820c94219f213996f49490de142c76 Mon Sep 17 00:00:00 2001 From: ryan Date: Wed, 20 Feb 2008 16:52:40 +0000 Subject: [PATCH] Skip main posts query if 404. Props misterbisson. fixes #5717 git-svn-id: http://svn.automattic.com/wordpress/trunk@6940 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/classes.php | 4 ++++ 1 file changed, 4 insertions(+) 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); }