From 42471b4882f103afca6e88a93a165c0a2377c675 Mon Sep 17 00:00:00 2001 From: azaozz Date: Sat, 15 Aug 2009 10:57:56 +0000 Subject: [PATCH] Fix displaying pages and attachments, props dd32, see #10605 git-svn-id: http://svn.automattic.com/wordpress/trunk@11822 1a063a9b-81f0-0310-95a4-ce76da25c4cd --- wp-includes/query.php | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/wp-includes/query.php b/wp-includes/query.php index 6a64b05e4..7b8538667 100644 --- a/wp-includes/query.php +++ b/wp-includes/query.php @@ -1596,7 +1596,7 @@ class WP_Query { if ( $this->is_search ) $q['post_type'] = 'any'; else - $q['post_type'] = 'post'; + $q['post_type'] = ''; } $post_type = $q['post_type']; if ( !isset($q['posts_per_page']) || $q['posts_per_page'] == 0 ) @@ -2078,8 +2078,9 @@ class WP_Query { $where .= " AND $wpdb->posts.post_type = 'attachment'"; } elseif ($this->is_page) { $where .= " AND $wpdb->posts.post_type = 'page'"; - } elseif ($this->is_single) { + } else { $where .= " AND $wpdb->posts.post_type = 'post'"; + $post_type = 'post'; } if ( isset($q['post_status']) && '' != $q['post_status'] ) {