query_posts ordering issue
-
Pulling my hair out trying to get these thumbnails to display in the latest order ‘newest first’ – Have tried various different permutations but still the thumbnails display as ‘oldest first’.
<div class="container"> <?php if ( have_posts() ) : ?> <?php query_posts(array( 'order'=>'desc', 'orderby'=>'post_date','category__and' => (22), 'showposts' => -1 )); $c = 0; ?> <?php while ( have_posts() ) : the_post(); $c++; ?> <div class="four columns"> <a title="<?php the_title(); ?>" href="<?php the_permalink() ?>" style="display:block;"> <?php if(has_post_thumbnail()) { the_post_thumbnail('medium'); } else { echo '<img src="'.get_bloginfo("template_url").'/images/img-default.png" width="220" height="147" />'; } ?> </a> <a title="<?php the_title(); ?>" href="<?php the_permalink() ?>"> <?php the_title(); ?> </a> <h6> <?php the_field('job_url'); ?> </h6> </div> <?php if( $c == 4) echo '</div><!--container end--><div class="container"><!--container start-->'; elseif ($c == 8) echo '</div><!--container end-->';?> <?php if( $c == 8) echo '<div class="container"><!--container start-->'; elseif ($c == 12) echo '</div><!--container end-->';?> <?php if( $c == 12) echo '<div class="container"><!--container start-->'; elseif ($c == 16) echo '</div><!--container end-->';?> <?php endwhile; endif; ?>
Viewing 8 replies - 1 through 8 (of 8 total)
Viewing 8 replies - 1 through 8 (of 8 total)
The topic ‘query_posts ordering issue’ is closed to new replies.