I am facing an issue with the meta query for my CPT. I have multiple values for a single meta key stored as a string separated with the '|' sign. I want to run a meta query that compares each value numerically and if meta has the >= to searched value it should return the result. suppose the stored meta value is "5000 | 6000 | 10000" the value search for is 4500
now it should return the above post meta as a result as it has 5000, 6000 & 10000.
here is meta query sample:
if(isset($_GET['sqft'])) {
if($_GET['sqft'] >= 1) {
$args['meta_query'][] = array(
'key' => 'pyre_property_size',
'value' => $_GET['sqft'],
'compare' => '>=',
'type' => 'numeric'
);
}
}
query_posts($args);
I want to compare it numerically not using 'Like' or 'REGEX' because they both looked for the exact or similar match, not the conditional logic. What change is required in that query to get the result?