admin管理员组文章数量:1130349
i have an array of meta values of an unknown length and i'm trying to query for posts that contain them.
The type of meta value is the checkbox type. So in ACF this is a list of 10 different checkboxes you can check. I take the checks made in HTML and am trying to query for posts with them when someone presses search.
here's what I have
$query = new WP_Query( array(
'posts_per_page' => 12,
'post_type' => 'post',
'post_status' => 'publish',
'meta_query' => array(
array(
'key' => 'category',
'value' => $checkboxes,
'compare' => 'In'
)
)
) );
the name of ACF checkboxes field is category, i'm trying to check if anything from category is in my checkboxes array. but nothing shows up>
i have an array of meta values of an unknown length and i'm trying to query for posts that contain them.
The type of meta value is the checkbox type. So in ACF this is a list of 10 different checkboxes you can check. I take the checks made in HTML and am trying to query for posts with them when someone presses search.
here's what I have
$query = new WP_Query( array(
'posts_per_page' => 12,
'post_type' => 'post',
'post_status' => 'publish',
'meta_query' => array(
array(
'key' => 'category',
'value' => $checkboxes,
'compare' => 'In'
)
)
) );
the name of ACF checkboxes field is category, i'm trying to check if anything from category is in my checkboxes array. but nothing shows up>
本文标签: advanced custom fieldsHow to query wordpress with array of metavalues
版权声明:本文标题:advanced custom fields - How to query wordpress with array of meta_values? 内容由热心网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:https://it.en369.cn/questions/1749212597a2333620.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。


发表评论