Support

Account

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 );
    ?>