wp_query Select & sort by multiple custom fields
-
I have multiple post types that all have same two custom fields : featured and fixed, booth Boolean.
I’m trying to get all the post that have the featured enabled and sort them so all the ones that have fixed true will be first in the query.this is what i have so far. it works for selecting the featured ones, but i can’t get the sorting part to work.
$args = array( 'post_type'=>array('panels', 'guests', 'amtv'), 'meta_query' => array( array ('key' => 'featured', 'value' => 1, 'compare' => '=', 'type' => 'CHAR' ), array ('key' => 'fixed' 'order' => 'ASC', 'orderby' => 'value' ) ) ); query_posts($args);
Any help would be appreciated ??
Viewing 1 replies (of 1 total)
Viewing 1 replies (of 1 total)
- The topic ‘wp_query Select & sort by multiple custom fields’ is closed to new replies.