I’m am displaying the last 5 posts of a custom post type ‘show’.
This gives me the latest post first.
<?php
$args = array(
'post_type' => 'show',
'posts_per_page' => 5,
'order' => 'DESC'
);
$home_shows = new WP_Query($args);
var_dump($home_shows);
?>
What I need is to actually have the earliest (of the array of the latest shows) first, and the latest show (in that array of latest shows) last.
I am now currently getting (the show date via a custom field meta value):
3/11/12, 3/7/12, 3/4/12, 3/2/12, 2/30/12
etc.
I need:
2/30/12,
3/1/12,
3/4/12,
3/7/12,
3/11/12,
I tried using php’s array_reverse like so (added to the above code):
$reversed_shows = array_reverse( $home_shows->posts );
Which gave me really odd results (displayed completely different parts of the post, array order was off).
Any ideas?