Want to order by Meta Values (tweaking Post Order Widget)

Because price is not a post table column (I’m assuming it’s a post meta field), you need to extend the query & order by meta_value_num instead: case ‘title’: if ( ! $meta_query = $vars->get( ‘meta_query’ ) ) $meta_query = array(); $meta_query[] = array( ‘compare’ => ‘!=’, ‘value’ => ”, ‘key’ => ‘price’, /* This should … Read more

how to query for meta_value have array

No, you can’t do that via a query. You can request everything then manually filter out items via PHP, but that would be slow. Instead, you need to address the root problem, that you’re storing serialised PHP data in a single field, rather than multiple fields, e.g. you should have an option1 meta key/value and … Read more