Make WordPress Core

Opened 15 years ago

Closed 15 years ago

#13241 closed defect (bug) (fixed)

query_posts stoped working on front page

Reported by: musarika's profile musarika Owned by: ryan's profile ryan
Milestone: 3.0 Priority: high
Severity: normal Version: 3.0
Component: Query Keywords:
Focuses: Cc:

Description

I am using wordpress 3.0, I upgraded to the latest nightly build. Everything else is working fine except for a small piece of code I have been using on a lot of my themes..

<?php $parent = $post->ID; ?>

<?php
query_posts('orderby=menu_order&order=ASC&posts_per_page=-1&post_type=page&post_parent='.$parent);
?>

After some debugging I realised that in the latest nightly build this code was changed in wp-includes/query.php Correct is_* for page_on_front and page_for_posts

if ( $this->is_home &&

'page' == get_option('show_on_front') && get_option('page_on_front') &&

( empty($query)
!array_diff( array_keys($this->query), array('preview', 'page', 'paged', 'cpage') ) )

) {

$this->is_page = true;
$this->is_home = false;
$qvpage_id? = get_option('page_on_front');
Correct <!--nextpage--> for page_on_front
if ( !empty($qvpaged?) ) {

$qvpage? = $qvpaged?;
unset($qvpaged?);

}

}

I am not sure if this is a bug or I might need to find a work around. I hope my explanation is clear enough.

Change History (2)

#1 @dd32
15 years ago

  • Summary changed from Wordpress 3.0 nightly build bug to query_posts stoped working on front page

Seems I've misunderstood $this->query to be an array. It actually contains the raw query (either the result of WP_Rewrite or the string passed in, etc.

Fix upcoming.

#2 @dd32
15 years ago

  • Resolution set to fixed
  • Status changed from new to closed

(In [14445]) Handle $wp_query->query being a string in r14341. See #12391, #12047. Fixes #13241

Note: See TracTickets for help on using tickets.