[wp-trac] [WordPress Trac] #15995: query is separating post_type 'post' and from custom post_types

WordPress Trac wp-trac at lists.automattic.com
Mon Dec 27 14:42:59 UTC 2010


#15995: query is separating post_type 'post' and from custom post_types
-------------------------------+------------------------------
 Reporter:  bowstreet          |       Owner:
     Type:  defect (bug)       |      Status:  new
 Priority:  normal             |   Milestone:  Awaiting Review
Component:  Post Types         |     Version:  3.0.3
 Severity:  normal             |  Resolution:
 Keywords:  reporter-feedback  |
-------------------------------+------------------------------

Comment (by bowstreet):

 I first forgot to test if it has to do with the meta_key and meta_value in
 the query. As soon as you call the posts with proper key and value it will
 sort like I pointed out above.

 I used this for the var_dump:

 {{{
         $feature_query = new WP_Query(
                 array(
             'post_type' => array(
                 'post',
                 'issues',
                 'videos',
             ),
                 'meta_key' => 'sticky',
                 'meta_compare' => '=',
                 'meta_value' => 'yes',
                 'orderby' => 'modified',
                 'order'=>'ASC' )
         );

                 var_dump($feature_query);

         if ( $feature_query->have_posts() ):
             while( $feature_query->have_posts() ) :
 $feature_query->the_post();
 }}}

-- 
Ticket URL: <http://core.trac.wordpress.org/ticket/15995#comment:3>
WordPress Trac <http://core.trac.wordpress.org/>
WordPress blogging software


More information about the wp-trac mailing list