filter using meta_query

117

$args = array(
  'post_type' => 'product',
  'product_cat' => $food_category->slug,
  'meta_query' => array(
     array(
        'key'     => '_location',
        'value'   => '%"newyork"%', // note the quotes
        'compare' => 'LIKE',
     ),
   ),
 );

Comments

Submit
0 Comments