LIKE %…% Meta Query
I have a serialized array as a meta value and I’m trying to run WP Query where it finds a specific value in the serialized array.
Here’s an example of the serialized array field:
Here’s my query, but it doesn’t work:
The ID’s are numberic I’m doing a search for as well.
$practiceArgs = array( 'post_type' => 'attorney', 'post_status' => 'publish', 'posts_per_page' => -1, 'meta_query' => array( array( 'key' => 'practice_area', 'value' => $post->ID, 'compare' => 'LIKE', 'type' => 'NUMERIC' ) ) );
I’ve tried using
'value' => '%'.$post-ID.'%' in my queries, but it doesn’t seem to work as well.
Anyone ever had any experience working on this?