WordPress.org

Ready to get started?Download WordPress

Forums

WP 3.1 breaks posts order via category__not_in ? (2 posts)

  1. khoich
    Member
    Posted 3 years ago #

    After migration from WP3.0.6 to WP3.1.3 my posts order is no longer work as before. My code is very simple just a little custom query on index.php in my template folder.

    <?php
    	$args = array(
    		'orderby' => 'title', 'order' => 'ASC',
    		'category__not_in' => array ('7')
    	);
    
    	$query = new WP_Query($args);
    	if($query->have_posts()) :
    	while ($query->have_posts()) : $query->the_post();
    		the_title(); echo '<br>';
    	endwhile;
    	endif;
    ?>

    Please suggest. Thanks in advance.

  2. JsonB123
    Member
    Posted 2 years ago #

    I'm having this very same issue!! Except my gets a little weirder: category__not_in works on my local MAMP version of my site but when I upload it to my web host it acts as you're probably experiencing: the posts no longer obey post ordering or orderby and revert to a orderby date order oldest to newest.

    Very frustrating.

Topic Closed

This topic has been closed to new replies.

About this Topic