I am having two custom post type "meet_our_community" and "news"
I have added a checkbox field named 'add_to_meet_our_community' from the acf to 'news' post type.
Now I when tried to take all the posts from 'meet_our_community' along with the 'news' posts where the meta key 'add_to_meet_our_community' checked with value 'Yes',I am not getting result
$args = array(
'post_type' => array( 'meet_our_community', 'news' ),
'posts_per_page' => -1,
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'add_to_meet_our_community', // ACF field key for 'news' post type
'value' => 'Yes',
'compare' => 'LIKE',
),
),
);
$combined_query = new WP_Query( $args );
Now I am getting only the correct result from the 'news'custom post only.But I need to get all the posts from 'meet_our_community' along with the news posts. how Can I add meta query that will reflect only on the news post on the WP_Query