Home › Forums › ACF PRO › Select all in filter › Reply To: Select all in filter
You need to dynamically generate your meta query based on the value submitted.
<?php
$region = $_GET["regions"];
$gender = $_GET["gender"];
global $wp_query;
$meta_query = array();
if ($region != 'all') {
$meta_query[] = array(
'key' => 'select_region',
'value' => $region,
'compare' => 'LIKE'
)
}
// .. do something similar for the other meta query parameters
$args = array_merge(
$wp_query->query_vars,
array(
'meta_query' => $meta_query;
)
);
query_posts( $args );
?>
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.