[wp-trac] [WordPress Trac] #8585: query_posts fails when I set category

WordPress Trac wp-trac at lists.automattic.com
Fri Dec 12 04:01:11 GMT 2008


#8585: query_posts fails when I set category
----------------------------+-----------------------------------------------
 Reporter:  juliovedovatto  |       Owner:  anonymous                      
     Type:  defect          |      Status:  new                            
 Priority:  normal          |   Milestone:  2.8                            
Component:  General         |     Version:  2.7                            
 Severity:  normal          |    Keywords:  query_posts fails category true
----------------------------+-----------------------------------------------
 I am using this code in my theme to query the posts.
 {{{
 <?php
 wp_reset_query();
                         query_posts(array(
                                                         'cat' => 7,
                                                         'orderby' =>
 "date",
                                                         'order' => "DESC",
                                                         'post__not_in' =>
 array(25,26,27),
                                                         'showposts' => 0,
                                                         'nopaging' => true
                                                 ));
 ?>
 }}}

 In the 2.6 version works fine this, when a made de Update to 2.7 the theme
 isn't loading.

 After few hours debugging, I found the misterious cause.

 wp-includes.php (line ~ 1328)
 {{{
 <?php
 if ( empty($qv['cat']) || ($qv['cat'] == '0') ) {
                                 $this->is_category = false;
                         } else {
                                 if (strpos($qv['cat'], '-') !== false) {
                                         $this->is_category = false;
                                 } else {
                                         $this->is_category = true; //Fails
 here
                                 }
                         }
 ?>
 }}}

 When the variable $this->is_category is set to TRUE, the script
 "mysteriously" fails, any thing after the line doesn't load.

 What I need to do to this works?

 regards,
 Julio

-- 
Ticket URL: <http://trac.wordpress.org/ticket/8585>
WordPress Trac <http://trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list