Home › Forums › General Issues › Checkbox filter – multiple queries › Reply To: Checkbox filter – multiple queries
Not sure how this is effecting your code, but your missing a closing } on your one of your loops
foreach( $GLOBALS['my_query_filters'] as $key => $name ) {
// continue if not found in url
if( empty($_GET[ $name ]) ) {
continue;
}
$values = explode(',', $_GET[ $name ]);
// I think there should be a } here before foreach( $values as $value ){
}
// I also think that you should be testing to see if there are any values
if ($values) {
$meta_query['relation'] = 'AND';
foreach( $values as $value ){
// append meta query
$meta_query[] = array(
'key' => $name,
'value' => '"' . $value . '"',
'compare' => 'LIKE',
);
}
}
Not sure if any of this will help or not
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.