views:

31

answers:

1

I'm trying to filter my posts to only show the ones with that have a custom value for the field "Model" while sorting the posts by another custom field called "Price."

Here's the function I'm using (not working):

<?php 
global $query_string;
query_posts( $query_string . "&meta_value=Model&orderby=meta_value&meta_key=Price&order=ASC"); 
?>

This function only shows Models, yet doesn't sort the posts by Price. If i add &meta_value=Model after order=ASC it sorts by Price but shows all posts, and not just Models.

A: 

did you try and array?

$args = array(
  'meta_value' => array('Model','Price')
    );
    query_posts($args);
philmadelphia
That doesn't return any results.
nurain
it was just an example of how to setup the array, put in your other paramaters as well.
philmadelphia