custom order in WP_QUERY
-
Hi
I would like to modify
<?php
// set up or arguments for our custom query
$paged = ( get_query_var(‘page’) ) ? get_query_var(‘page’) : 1;
$query_args = array(
‘post_type’ => ‘mycustompost’,
‘posts_per_page’ => 25,
‘order’ => ‘DESC’,
‘paged’ => $paged
);
// create a new instance of WP_Query
$the_query = new WP_Query( $query_args );
?>I have 3 (year, type and category) taxonomy for a custom post type; I would like to sort them first by year then category and finally by type.
How can i do that ? Do I need custom SQL resuest or could I use as meta date sort filter ?
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
The topic ‘custom order in WP_QUERY’ is closed to new replies.