• I’m working with query_posts to generate a list of posts. It’s returning my results in alphabetical order even though I have specifically set order_by to date, and order to DESC (these are the defaults as well).

    Any thoughts on what I’m doing wrong?

    My site is here:
    http://76.74.242.200/~belle856/wordpress/articles/

    The code I’m using is here:

    <?php
    	$args = array( 'post_type' => 'article_type', 'orderby' => 'date', 'order' => 'DESC', 'posts_per_page' => 10, 'paged' => get_query_var('paged') );
    	query_posts( $args );
    	if (have_posts()) : while (have_posts()) : the_post();
    ?>

    Note that if I set order_by and/or order to any other (non-default) values, it works; I can set order_by, for example, to modified date,or set order to ASC, and then my results are correct. It’s only when using the default values (even the default values, expressly set) that I get erroneous alphabetical results.

  • The topic ‘query_posts returning results in alphabetical order’ is closed to new replies.