WP_Query use for a filter with multiple Taxonomies and Terms
Try this way: $args = array( ‘orderby’ => ‘date’, ‘order’ => ‘DESC’, ‘post_status’ => ‘publish’ ); if ( isset( $_POST[‘typefilter’] ) && $_POST[‘typefilter’] !== ” ) { $args[‘post_type’] = ‘post_type_x’; $args[‘tax_query’][0][‘taxonomy’] = ‘type_emp’; $args[‘tax_query’][0][‘field’] = ‘id’; $args[‘tax_query’][0][‘terms’] = $_POST[‘typefilter’]; $args[‘tax_query’][0][‘operator’] = ‘IN’; } if ( $_POST[‘typefilter’] == ”) { $args[‘post_type’] = ‘post_type_x’; } // If … Read more