WordPress.org

Make WordPress Core

Changes between Initial Version and Version 1 of Ticket #15995, comment 2


Ignore:
Timestamp:
12/27/2010 02:35:25 PM (7 years ago)
Author:
bowstreet
Comment:

Legend:

Unmodified
Added
Removed
Modified
  • Ticket #15995, comment 2

    initial v1  
    1 This is weird, I have two WP's running, one the actual site and one was the mirror for testing purpose, I just reset the DB of the mirror and it is ordering fine there. I think there is something in the backend that I changed which causes the bug, but I don't know exactly where to start searching right now.
     1Seems it has to do with meta_key and meta_value I'm using.
    22
    3 Replying to [comment:1 dd32]:
    4 > This is working as I'd expect..
    5 >
    6 > {{{
    7 > post - AAA
    8 > note - BBB
    9 > post - CCC
    10 > }}}
    11 >
    12 > Can you add `var_dump($wp_query);` after your query_posts call, save the output to a file and attach it here? It'll help understand how/why it may be occurring.
     3{{{
     4        $feature_query = new WP_Query(
     5                array(
     6            'post_type' => array(
     7                'post',
     8                'issues',
     9                'videos',
     10            ),
     11                'meta_key' => 'sticky',
     12                'meta_compare' => '=',
     13                'meta_value' => 'yes',
     14                'orderby' => 'modified',
     15                'order'=>'ASC' )
     16        );
     17               
     18                var_dump($feature_query);
     19
     20        if ( $feature_query->have_posts() ):
     21            while( $feature_query->have_posts() ) : $feature_query->the_post();
     22}}}
     23