I need to get posts with specific post meta. If I inspect regular loop using following code:
$args = array(
'post_status' => 'published',
'posts_per_page' => 77,
'post_type' => 'post',
);
$query = new WP_Query($args);
while ($query->have_posts()) : $query->the_post();
$literature = get_post_meta(get_the_ID(), 'popis_literature');
var_dump($literature);
endwhile;
for some posts var_dump
gives an array of data like this
array (size=1)
0 =>
array (size=2)
0 => string '32985' (length=5)
1 => string '59956' (length=5)
How can I query posts by one of those IDs? This doesn't give me anything
$args = array(
'post_status' => 'published',
'posts_per_page' => -1,
'post_type' => 'post',
'meta_query' => array(
array(
'key' => 'popis_literature',
'value' => array('32985'),
'compare' => 'IN'
)
),
);