Skip to content

Instantly share code, notes, and snippets.

@benytocarlo
Created January 21, 2014 13:10
Show Gist options
  • Save benytocarlo/8539735 to your computer and use it in GitHub Desktop.
Save benytocarlo/8539735 to your computer and use it in GitHub Desktop.
Order by meta_value
$args = array(
'showposts' => 20,
'post_type' => array( 'automoviles' ),
'meta_key' => 'Precio',
'orderby' => 'meta_value_num',
'order' => 'ASC',
'post_parent' => $postid,
'tax_query' => array(
'relation' => 'AND',
array(
'taxonomy' => 'marcas',
'field' => 'slug',
'terms' => array( $marcaslug )
)
)
);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment