Fix displaying pages and attachments, props dd32, see #10605

git-svn-id: https://develop.svn.wordpress.org/trunk@11822 602fd350-edb4-49c9-b593-d223f7449a82
This commit is contained in:
Andrew Ozz 2009-08-15 10:57:56 +00:00
parent 6e39ca2cb0
commit 5e8dbc10cd
1 changed files with 3 additions and 2 deletions

View File

@ -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'] ) {