Very Specific query needed
-
I need to display the 5 latest entries of a custom post type. Not a problem:
$args = array( 'post_type' => 'show', 'posts_per_page' => 5, 'orderby' => 'meta_value', 'meta_key' => 'show_date', 'order' => 'DESC' ); $home_shows = new WP_Query($args);
I’m stumbling with the next part though: I need to then display those latest posts starting with the earliest post.
In essence, I need to take the last 5 posts, then reverse their order.
I tried using the php function ‘array_reverse,’ but ended up with some really funky stuff happening (it successfully reversed the array, but I was getting very odd content showing up).
Any ideas?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘Very Specific query needed’ is closed to new replies.