Home › Forums › General Issues › Get all posts that have at least one value in a group › Reply To: Get all posts that have at least one value in a group
Well, yes it would be possible, but it’s probably going to cause performance issues with the query, it might event time out your site. You need to check every value.
group sub field meta keys are as follows
"{$group_field_name}_{$sub_field_name}"
nested group fields
"{$group_field_name}_{$nested_group_field_name}_{$sub_field_name}"
$args = array(
'cat' => 3,
'post_type' => 'post',
'posts_per_page' => $atts['partite'],
'meta_query' => array(
'relation' => 'AND',
array(
'key' => 'data_match',
'compare' => '>=',
'value' => date_i18n('Y-m-d H:i'),
'type' => 'DATETIME'
),
array(
'relation' => 'OR',
array(
'key' => 'meta_key',
'value' => ''
'compare' => '!='
),
// repeat the above array for every field you want to check
),
),
'order' => 'ASC',
'orderby' => 'meta_value',
'meta_key' => 'data_match',
);
Welcome to the Advanced Custom Fields community forum.
Browse through ideas, snippets of code, questions and answers between fellow ACF users
Helping others is a great way to earn karma, gain badges and help ACF development!
We use cookies to offer you a better browsing experience, analyze site traffic and personalize content. Read about how we use cookies and how you can control them in our Privacy Policy. If you continue to use this site, you consent to our use of cookies.