I need to pass dynamic value in to the value key in the meta_query array in the wp_query. Is it possible to pass the dynamic value in the query. My Code is
$prodPost = new WP_Query( array(
'post_type' => 'product',
'posts_per_page' => 6,
'paged' => 1,
'meta_query' => array(
array(
'relation' => 'AND'
),
array(
'key' => 'product_last_date',
'value' => date('d-m-Y'),
'compare' => '>',
),
array(
'key' => 'product_limit',
'value' => $limit,
'compare' => '>',
),
),
) );
As you see in my query i need to query the product which satisfies both condition, but the problem with second condition is that I need to pass the $limit
value dynamically for the corresponding product post. Is there any to accomplish this query. Thanks in advance