WP Query and order by particular specified IDs
-
My WP_Query request looks like:
$query_args = array('posts_per_page' => $products, 'no_found_rows' => 1, 'post_status' => 'publish', 'post_type' => 'product' ); $query_args['meta_query'] = $woocommerce->query->get_meta_query(); $query_args['meta_query'][] = array( 'key' => '_featured', 'value' => 'yes' ); $r = new WP_Query($query_args);
What argument I need to add to return a query ordered by IDs in a particular row (ex. I need to return products IDs 161,165,131,202 in that order).
Viewing 9 replies - 1 through 9 (of 9 total)
Viewing 9 replies - 1 through 9 (of 9 total)
- The topic ‘WP Query and order by particular specified IDs’ is closed to new replies.